A method, device and equipment for suspending and resuming distributed transactions

By using REDIS middleware in transaction suspension processing, distributed transaction suspension continuation is realized, which solves the low efficiency and risk problems of relational databases under high concurrency, improves transaction response speed and processing efficiency, and reduces system costs. Risk, support distributed design and sub-database and sub-table technology.

CN113095840BInactive Publication Date: 2024-09-27BANK OF CHINA
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202110486307.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-30
Publication Date
2024-09-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Under distributed high concurrency conditions, the existing transaction suspension processing solution results in low reading and writing efficiency of relational databases, IO performance bottlenecks, untimely transaction processing, and even the risk of system crash, affecting user experience.

Method used

Using the distributed transaction suspension continuation method based on REDIS, the target server information and suspension thread ID are written into the REDIS middleware through the transaction suspension polling module, and the information is read cyclically. When the combined information and supplementary information exist, Delete information and perform business processing, and use the publish and subscribe function of REDIS to realize zero-time interval information interaction between master and sub-transactions.

Benefits of technology

It improves the response speed and processing efficiency of pending transactions, releases the load pressure on relational databases, reduces system risks, supports distributed design and sub-database and sub-table technology, and improves the system's expansion response capability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113095840B
    Figure CN113095840B
Patent Text Reader

Abstract

The present application discloses a method, device and equipment for suspending and resuming distributed transactions, which can improve the response speed and processing efficiency of suspended transactions based on the distributed transaction suspension and resuming method of REDIS, while releasing the load pressure of the relational database server and reducing the system risk. The method includes: first calling the main transaction suspension polling module to enter the suspension node, then, writing the target server information and the combination information of the suspension thread ID of the current main transaction into the REDIS middleware through the transaction suspension polling module, then, cyclically reading the REDIS information, when it is determined that both the combination information and the supplementary information exist, deleting the combination information and the supplementary information on the REDIS middleware; and performing post-suspension business processing according to the supplementary information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device and equipment for suspending and resuming distributed transactions. Background Art

[0002] With the rapid development of social economy, major banks, as the center of financial services, are increasingly used by customers to conduct various transactions through banks. Among them, transaction suspension refers to dividing a transaction into two transactions, the main transaction and the sub-transaction. The main transaction is processed to the suspension node, and the thread needs to wait to obtain the supplementary information sent by the sub-transaction (initiated by other systems such as the bank card system); after the main transaction obtains the information, it continues to process, and after the processing is completed, the result is returned to the upstream system.

[0003] However, in the existing transaction suspension processing solution, the main transaction is executed to the suspension stage, and the relational database (such as Oracle) is read cyclically to obtain the supplementary information sent by the sub-transaction (the sub-transaction saves the information in the database). As a result, in the case of distributed high concurrency, there are technical problems such as low relational database reading and writing efficiency, IO performance bottlenecks, untimely transaction processing, and the inability to use sharding technology. There is even a risk of system operation crashing and affecting user experience. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to provide a method, device and equipment for suspending and resuming distributed transactions, which can improve the response speed and processing efficiency of suspended transactions based on the distributed transaction suspension and resuming method of REDIS, while releasing the load pressure of the relational database server and reducing system risks.

[0005] In a first aspect, an embodiment of the present application provides a method for suspending and resuming a distributed transaction, comprising:

[0006] S1: Call the main transaction suspension polling module and enter the suspension node;

[0007] S2: Write the target server information and the combination of the suspended thread ID of the current main transaction into the REDIS middleware through the transaction suspension polling module;

[0008] S3: cyclically reading REDIS information, and when it is determined that both the combination information and the supplementary information exist, deleting the combination information and the supplementary information on the REDIS middleware; and performing post-suspend business processing according to the supplementary information.

[0009] Optionally, the method further includes:

[0010] Calling the main transaction monitoring module to monitor the subject information of the target server in the REDIS middleware in real time; the subject information includes the combination information and supplementary information written into the REDIS middleware by the sub-transaction processing module;

[0011] According to the combination information, the suspended thread ID of the current main transaction is extracted, and the suspended thread is awakened according to the ID, and step S3 is executed.

[0012] Optionally, after writing the target server information and the combined information of the suspended thread ID of the current main transaction into the REDIS middleware through the transaction suspension polling module, the method further comprises:

[0013] In the REDIS middleware, set the target server information and the validity period of the key-value corresponding to the suspended thread ID of the current main transaction.

[0014] Optionally, the method further includes:

[0015] When the REDIS information is read cyclically within the validity period and it is determined that the combination information does not exist, the key-value corresponding to the target server information and the suspended thread ID of the current main transaction is deleted in the REDIS middleware.

[0016] In a second aspect, the embodiment of the present application further provides a device for suspending and resuming a distributed transaction, including:

[0017] A first calling unit is used to call the main transaction suspension polling module and enter the suspension node;

[0018] A writing unit, used for writing the target server information and the combination information of the suspended thread ID of the current main transaction into the REDIS middleware through the transaction suspension polling module;

[0019] The processing unit is used for cyclically reading REDIS information, and when it is determined that both the combined information and the supplementary information exist, deleting the combined information and the supplementary information on the REDIS middleware; and performing post-suspend business processing according to the supplementary information.

[0020] Optionally, the device further comprises:

[0021] The second calling unit is used to call the main transaction monitoring module to monitor the subject information of the target server in the REDIS middleware in real time; the subject information includes the combination information and supplementary information written into the REDIS middleware by the sub-transaction processing module;

[0022] The third calling unit is used to extract the suspended thread ID of the current main transaction according to the combination information, wake up the suspended thread according to the ID, and call and execute the processing unit.

[0023] Optionally, the device further comprises:

[0024] The setting unit is used to set the validity period of the key-value corresponding to the target server information and the suspended thread ID of the current main transaction in the REDIS middleware after the combined information of the target server information and the suspended thread ID of the current main transaction is written into the REDIS middleware through the transaction suspension polling module.

[0025] Optionally, the device further comprises:

[0026] The deleting unit is used to delete the key-value corresponding to the target server information and the suspended thread ID of the current main transaction in the REDIS middleware when cyclically reading the REDIS information within the validity period and determining that the combined information does not exist.

[0027] The embodiment of the present application also provides a device for suspending and resuming distributed transactions, including: a processor, a memory, and a system bus;

[0028] The processor and the memory are connected via the system bus;

[0029] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes any one of the implementation methods of the above-mentioned method for suspending and resuming distributed transactions.

[0030] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes any one of the implementation methods of the above-mentioned distributed transaction suspension and continuation method.

[0031] The embodiment of the present application provides a method, device and equipment for suspending and resuming a distributed transaction. First, the main transaction suspension polling module is called to enter the suspension node. Then, the target server information and the combination information of the suspension thread ID of the current main transaction are written into the REDIS middleware through the transaction suspension polling module. Then, the REDIS information is read cyclically. When it is determined that both the combination information and the supplementary information exist, the combination information and the supplementary information on the REDIS middleware are deleted; and the post-suspension business processing is performed according to the supplementary information. Therefore, the distributed transaction suspension and resuming method based on REDIS can improve the response speed and processing efficiency of suspended transactions, while releasing the load pressure of the relational database server and reducing system risks. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0033] Figure 1 A transaction diagram of the existing Bank of China financial IC card system provided in the embodiment of the present application;

[0034] Figure 2 A flow chart of a method for suspending and resuming a distributed transaction provided in an embodiment of the present application;

[0035] Figure 3 A schematic diagram of the structure of a distributed transaction suspension and continuation system provided in an embodiment of the present application;

[0036] Figure 4 A schematic diagram of the process of distributed transaction suspension continuation on the main transaction suspension polling module side provided in an embodiment of the present application;

[0037] Figure 5 A schematic diagram of the process of suspending and resuming a distributed transaction on the sub-transaction processing module side provided in an embodiment of the present application;

[0038] Figure 6 A schematic diagram of the composition of a distributed transaction suspension and continuation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] In the banking industry, transaction suspension means dividing a transaction into two transactions: a main transaction and a sub-transaction. When the main transaction is processed to the suspension node, a thread needs to wait to obtain the supplementary information sent by the sub-transaction (initiated by other systems such as the bank card system). After the main transaction obtains the information, it continues to process, and after the processing is completed, the result is returned to the upstream system.

[0040] However, in the existing transaction suspension processing solution, the main transaction is executed to the suspension stage, and the relational database (such as Oracle) is read cyclically to obtain the supplementary information sent by the sub-transaction (the sub-transaction saves the information in the database). As a result, in the case of distributed high concurrency, there are technical problems such as low relational database reading and writing efficiency, IO performance bottlenecks, untimely transaction processing, and the inability to use sharding technology. There is even a risk of system operation crashing and affecting user experience.

[0041] For example: Figure 1As shown in the figure, for the Bank of China financial IC card system, its main function is to query and process QR code transactions. In the merchant reverse scanning transaction process, the Bank of China merchant initiates the main transaction, and the financial IC card system first performs pre-suspension business processing and initiates a transaction request to UnionPay. After receiving the consumption request, UnionPay will immediately return a synchronous response; then the current main transaction is suspended, waiting for the UnionPay system to send the sub-transaction "C2B consumption result notification"; after the main transaction obtains the supplementary information of the sub-transaction, it performs post-suspension business processing and returns the result to the upstream system. The main and sub-transactions use the relational database oracle to realize information interaction. The main transaction is processed to the suspension node to read the oracle cyclically to obtain the supplementary information. If the supplementary information is obtained within the limited time, the transaction continues and the result is returned to the upstream system; if the supplementary information cannot be obtained within the limited time, the transaction is rejected due to timeout, and the error information is returned to the upstream system. The financial IC card system receives the sub-transaction sent by the UnionPay system, inserts the supplementary information into the relational database oracle, waits for the main transaction to read, and completes the information interaction between the main and sub-transactions.

[0042] It can be seen that the existing transaction suspension processing solution has the following four problems: First, the relational database Oracle is used to realize the information interaction between the master and sub-transactions, which has low read and write efficiency and makes it impossible for the system to adopt the technology of sub-library and sub-table. With the surge in transaction volume and the huge growth of data, IO performance bottlenecks are prone to occur, which drags down the operation efficiency of the system. Second, the system uses a centralized database and cannot support the rapid expansion of business and the rapid expansion of the system. Third, the main transaction uses a cyclic polling database information method, which occupies database resources and affects the performance of other transactions. Fourth, developers need to pay attention to the definition of the polling time interval; if the polling time interval is defined too short, the main transaction reads the database too frequently, consumes a large amount of relational database resources, and is prone to insufficient memory and IO performance bottlenecks; if the polling time interval is defined too long, the main transaction processing time is too long, resulting in a poor user experience.

[0043] To address the above-mentioned defects, an embodiment of the present application provides a method for suspending and resuming distributed transactions, which utilizes a high-performance key-value in-memory database REDIS to implement information interaction between master and sub-transactions, thereby improving the efficiency of information interaction between master and sub-transactions and relieving the load pressure of relational databases. At the same time, it supports the distributed design of the system, fully enjoys the benefits brought by the database and table sharding technology, and realizes rapid expansion response of the system. At the same time, the REDIS publish-subscribe function is utilized to implement zero-time interval information interaction between master and sub-transactions, so that developers do not need to pay excessive attention to the definition of polling time intervals.

[0044] The specific implementation process is as follows: first, the main transaction suspension polling module is called to enter the suspension node, and then, the target server information and the combination information of the suspension thread ID of the current main transaction are written to the REDIS middleware through the transaction suspension polling module. Then, the REDIS information is read cyclically. When it is determined that both the combination information and the supplementary information exist, the combination information and the supplementary information on the REDIS middleware are deleted; and the post-suspension business processing is performed according to the supplementary information. In this way, the distributed transaction suspension continuation method based on REDIS can improve the response speed and processing efficiency of suspended transactions, while releasing the load pressure of the relational database server and reducing system risks.

[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, 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 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 are within the scope of protection of this application.

[0046] First embodiment

[0047] See also Figure 2 , is a flow chart of a method for suspending and resuming a distributed transaction provided in this embodiment, the method comprising the following steps:

[0048] S1: Call the main transaction suspension polling module and enter the suspension node.

[0049] In this embodiment, in order to improve the response speed and processing efficiency of suspended transactions, release the load pressure of the relational database server and reduce system risks, this application proposes to use REDIS to replace Oracle as the master-sub-transaction message interaction medium to form a new distributed transaction suspension continuation system, such as Figure 3As shown, the system includes the following five modules: First, the business processing module before and after the main transaction is suspended, which is used to receive and respond to the upstream system message, perform business verification and logic processing before and after the transaction is suspended, and ensure the correctness and rationality of the business. Second, the sub-transaction processing module is used to receive the message sent by other systems, perform simple business processing, and publish the subject message to the REDIS message middleware and write the supplementary information of the main transaction. Third, the REDIS message middleware is used to receive the combined information written by the main transaction suspension polling module, the subject published by the sub-transaction processing module, and the supplementary information written. Fourth, the main transaction monitoring module is used to monitor the message published by the sub-transaction, actively wake up the thread of the main transaction; and after the main transaction is awakened, obtain the supplementary information from the REDIS message middleware to carry out the next business processing. Fifth, the main transaction suspension polling module is used to suspend the current business processing, and read REDIS cyclically within a limited time to obtain the supplementary information of the main transaction; if the information is obtained within the specified time, the business processing will continue; if it times out, it will be rejected.

[0050] On this basis, after receiving the main transaction of the suspended transaction sent by the upstream, in order to realize the distributed transaction suspension continuation, the above system first needs to call the main transaction suspension pre-business processing module to perform a simple logic check (such as checking whether the personal account information is accurate or whether the merchant information is accurate, etc.), and then call the main transaction suspension polling module to enter the suspension node, such as Figure 4 As shown, it is used to execute the subsequent step S2.

[0051] S2: Write the target server information and the combined information of the suspended thread ID of the current main transaction into the REDIS middleware through the transaction suspension polling module.

[0052] In this embodiment, the main transaction suspension polling module is called through step S1. After entering the suspension node, the target server information (such as the IP address of the target server) and the combination information of the suspension thread ID of the current main transaction can be further written into the REDIS middleware through the transaction suspension polling module to execute the subsequent step S3.

[0053] An optional implementation method is that after the target server information and the combination information of the suspended thread ID of the current main transaction are written into the REDIS middleware through the transaction suspension polling module, the validity period of the key-value corresponding to the target server information and the suspended thread ID of the current main transaction can be set in the REDIS middleware to execute the subsequent step S3. The validity period is greater than the timeout period of the main transaction.

[0054] S3: Circularly read REDIS information, and when it is determined that both the combined information and the supplementary information exist, delete the combined information and the supplementary information on the REDIS middleware; and perform post-suspend business processing according to the supplementary information.

[0055] In this embodiment, after writing the target server information and the combination information of the suspended thread ID of the current main transaction into the REDIS middleware in step S2, the REDIS information can be further read cyclically to determine whether the combination information and the supplementary information exist.

[0056] When the REDIS information is read cyclically within the validity period and it is determined that the combined information does not exist, the key-value corresponding to the target server information and the suspended thread ID of the current main transaction is deleted in the REDIS middleware, indicating that the transaction is rejected due to timeout.

[0057] If it is determined that the combination information exists but the supplementary information does not exist, the thread is suspended for a certain period of time and the occupied server resources are released. After a certain period of time, the thread is unsuspended, and the combination information and supplementary information are read and determined again, and this process is repeated.

[0058] If it is determined that the combined information exists but the supplementary information exists, the loop ends, and the combined information and supplementary information on the REDIS middleware are deleted, and the post-suspend business processing is performed according to the supplementary information.

[0059] In addition, an optional implementation method is that the present application also needs to perform the following steps AB:

[0060] Step A: Call the main transaction monitoring module to monitor the subject information of the target server in the REDIS middleware in real time; wherein the subject information includes the combination information and supplementary information written into the REDIS middleware by the sub-transaction processing module.

[0061] In this implementation, the main transaction monitoring module of the system can be called to monitor the relevant target server topics (such as Figure 4 As shown in FIG. 1 ). Once the sub-transaction publishes information about the target server topic, the main transaction monitoring module of the target server immediately responds and obtains the combined information according to the published information to execute the subsequent step B.

[0062] Among them, it should be noted that the information of each server in this application is unique, and it is necessary to ensure that each server listens to different topics (topics and server information are bound one-to-one, and there will be no one-to-many or many-to-one relationship) to achieve the purpose of reducing the energy consumption of the server. At the same time, when this application uses REDIS as the main and sub-transaction message interaction medium, it is to use the transaction information shared by the main and sub-transactions as the key, and at the same time ensure the uniqueness of the key, that is, the key between the main transactions is uniquely determined, even the keys of multiple transactions of the same merchant are uniquely determined.

[0063] Step B: Extract the suspended thread ID of the current main transaction according to the combined information, wake up the suspended thread according to the ID, and execute step S3.

[0064] In this implementation, if the main transaction monitoring module is called in step A to monitor in real time that the subject information of the target server in the REDIS middleware does not contain combination information, the monitoring processing logic ends; if the main transaction monitoring module is called in step A to monitor in real time that the subject information of the target server in the REDIS middleware does contain combination information, the suspended thread ID of the current main transaction can be extracted according to the combination information, and the suspended thread can be awakened according to the ID, and step S3 is executed to perform post-suspension business processing according to the supplementary information.

[0065] It should be noted that in order to improve the response speed and processing efficiency of suspended transactions, while releasing the load pressure of the relational database server and reducing system risks. Figure 5 As shown, after receiving the sub-transaction sent by the UnionPay system, the sub-transaction processing module will obtain the combination information from REDIS according to the business primary key. If the combination information exists, the supplementary information of the main transaction will be written to REDIS, and then the server information will be extracted from the combination information, and a message will be published to the topic related to the server information. The main transaction monitoring module of each server only monitors the topics related to this server, so as to only respond to the information of the main transaction being processed by this server, rather than responding to the information of other servers, thereby greatly alleviating the pressure of server response.

[0066] In this way, by executing the above steps S1-S3, the following four purposes can be achieved: First, the non-relational database REDIS based on memory storage is used as the transmission medium for the interaction of master and sub-transaction information, which not only improves the rate of information reading and writing, but also greatly reduces the access to the database server. Second, the design of the entire processing system is no longer constrained by suspension. For high-concurrency big data, a distributed design solution with separate libraries and tables can be adopted to reduce the pressure of resource access. Third, by adopting the subscription and polling method, the main transaction can respond to the information provided by the sub-transaction in zero time, and ensure the security and reliability of the system. Fourth, by adopting 4. dynamic theme method, the main transaction monitoring module corresponding to the current server only monitors the messages of the current server's own theme, which reduces the server monitoring frequency and reduces resource consumption.

[0067] In summary, the present embodiment provides a method for suspending and resuming a distributed transaction. First, the main transaction suspension polling module is called to enter the suspension node. Then, the combination information of the target server and the suspension thread ID of the current main transaction is written to the REDIS middleware through the transaction suspension polling module. Then, the REDIS information is read cyclically. When it is determined that both the combination information and the supplementary information exist, the combination information and the supplementary information on the REDIS middleware are deleted; and the post-suspension business processing is performed according to the supplementary information. Therefore, the distributed transaction suspension and resuming method based on REDIS can improve the response speed and processing efficiency of suspended transactions, while releasing the load pressure of the relational database server and reducing system risks.

[0068] Second embodiment

[0069] This embodiment will introduce a device for suspending and resuming distributed transactions. For related content, please refer to the above method embodiment.

[0070] See also Figure 6 , is a schematic diagram of the composition of a distributed transaction suspension and continuation device provided in this embodiment, the device includes:

[0071] The first calling unit 601 is used to call the main transaction suspension polling module and enter the suspension node;

[0072] The writing unit 602 is used to write the target server information and the combination information of the suspended thread ID of the current main transaction into the REDIS middleware through the transaction suspension polling module;

[0073] The processing unit 603 is used to read the REDIS information cyclically, and when it is determined that both the combination information and the supplementary information exist, delete the combination information and the supplementary information on the REDIS middleware; and perform post-suspend business processing according to the supplementary information.

[0074] In an implementation of this embodiment, the device further includes:

[0075] The second calling unit is used to call the main transaction monitoring module to monitor the subject information of the target server in the REDIS middleware in real time; the subject information includes the combination information and supplementary information written into the REDIS middleware by the sub-transaction processing module;

[0076] The third calling unit is used to extract the suspended thread ID of the current main transaction according to the combination information, wake up the suspended thread according to the ID, and call and execute the processing unit 603.

[0077] In an implementation of this embodiment, the device further includes:

[0078] The setting unit is used to set the validity period of the key-value corresponding to the target server information and the suspended thread ID of the current main transaction in the REDIS middleware after the combined information of the target server information and the suspended thread ID of the current main transaction is written into the REDIS middleware through the transaction suspension polling module.

[0079] In an implementation of this embodiment, the device further includes:

[0080] The deleting unit is used to delete the key-value corresponding to the target server information and the suspended thread ID of the current main transaction in the REDIS middleware when cyclically reading the REDIS information within the validity period and determining that the combined information does not exist.

[0081] In summary, the present embodiment provides a distributed transaction suspension and continuation device, which first calls the main transaction suspension polling module to enter the suspension node, and then writes the target server information and the combination information of the suspension thread ID of the current main transaction into the REDIS middleware through the transaction suspension polling module, and then cyclically reads the REDIS information. When it is determined that both the combination information and the supplementary information exist, the combination information and the supplementary information on the REDIS middleware are deleted; and the post-suspension business processing is performed according to the supplementary information. Therefore, the distributed transaction suspension and continuation method based on REDIS can improve the response speed and processing efficiency of suspended transactions, while releasing the load pressure of the relational database server and reducing system risks.

[0082] Furthermore, the embodiment of the present application also provides a device for suspending and resuming distributed transactions, including: a processor, a memory, and a system bus;

[0083] The processor and the memory are connected via the system bus;

[0084] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes any one of the implementation methods of the above-mentioned distributed transaction suspension and continuation method.

[0085] Furthermore, an embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes any one of the implementation methods of the above-mentioned distributed transaction suspension and continuation method.

[0086] It can be known from the description of the above implementation mode that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0087] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0088] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0089] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for suspending and resuming distributed transactions, characterized in that: include: S1: Call the main transaction suspension polling module and enter the suspension node; S2: Write the target server information and the combination of the suspended thread ID of the current main transaction into the REDIS middleware through the transaction suspension polling module; S3: cyclically reading REDIS information, and when it is determined that both the combination information and the supplementary information exist, deleting the combination information and the supplementary information on the REDIS middleware; and carry out post-suspension business processing according to the supplementary information; The method further comprises: Call the main transaction monitoring module to monitor the subject information of the target server in the REDIS middleware in real time; The subject information includes the combined information and supplementary information written into the REDIS middleware by the sub-transaction processing module; According to the combination information, the suspended thread ID of the current main transaction is extracted, and the suspended thread is awakened according to the ID, and step S3 is executed.

2. The method according to claim 1, characterized in that After writing the target server information and the combined information of the suspended thread ID of the current main transaction into the REDIS middleware through the transaction suspension polling module, the method further comprises: In the REDIS middleware, set the target server information and the validity period of the key-value corresponding to the suspended thread ID of the current main transaction.

3. The method according to claim 2, characterized in that The method further comprises: When the REDIS information is read cyclically within the validity period and it is determined that the combination information does not exist, the key-value corresponding to the target server information and the suspended thread ID of the current main transaction is deleted in the REDIS middleware.

4. A device for suspending and resuming distributed transactions, characterized in that: include: A first calling unit is used to call the main transaction suspension polling module and enter the suspension node; A writing unit, used for writing the target server information and the combination information of the suspended thread ID of the current main transaction into the REDIS middleware through the transaction suspension polling module; A processing unit, configured to cyclically read REDIS information, and when it is determined that both the combined information and the supplementary information exist, delete the combined information and the supplementary information on the REDIS middleware; and carry out post-suspension business processing according to the supplementary information; The device also includes: The second calling unit is used to call the main transaction monitoring module to monitor the subject information of the target server in the REDIS middleware in real time; the subject information includes the combination information and supplementary information written into the REDIS middleware by the sub-transaction processing module; The third calling unit is used to extract the suspended thread ID of the current main transaction according to the combination information, wake up the suspended thread according to the ID, and call and execute the processing unit.

5. The device according to claim 4, characterized in that The device also includes: The setting unit is used to set the validity period of the key-value corresponding to the target server information and the suspended thread ID of the current main transaction in the REDIS middleware after the combined information of the target server information and the suspended thread ID of the current main transaction is written into the REDIS middleware through the transaction suspension polling module.

6. The device according to claim 5, characterized in that The device also includes: The deleting unit is used to delete the key-value corresponding to the target server information and the suspended thread ID of the current main transaction in the REDIS middleware when cyclically reading the REDIS information within the validity period and determining that the combined information does not exist.

7. A device for suspending and resuming distributed transactions, characterized in that: include: Processor, memory, system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, wherein the one or more programs include instructions, and when the instructions are executed by the processor, the processor executes the method according to any one of claims 1 to 3.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • A data processing method of a financial system and electronic equipment

    CN109741165A

  • Big data free query method and device

    CN110580258A

  • User equipment and server for providing user authentication documents

    KR1020180033994A

  • Apparatus and method of analyzing service processing status

    US20090248803A1

  • Database management system and database management method

    US20200265050A1