CN113095840A - Method, device and equipment for distributed transaction suspension continuous operation - Google Patents

Method, device and equipment for distributed transaction suspension continuous operation Download PDF

Info

Publication number
CN113095840A
CN113095840A CN202110486307.7A CN202110486307A CN113095840A CN 113095840 A CN113095840 A CN 113095840A CN 202110486307 A CN202110486307 A CN 202110486307A CN 113095840 A CN113095840 A CN 113095840A
Authority
CN
China
Prior art keywords
information
transaction
redis
pending
middleware
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110486307.7A
Other languages
Chinese (zh)
Other versions
CN113095840B (en
Inventor
徐世泽
周宝琛
李炫裕
罗丹
杨阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202110486307.7A priority Critical patent/CN113095840B/en
Publication of CN113095840A publication Critical patent/CN113095840A/en
Application granted granted Critical
Publication of CN113095840B publication Critical patent/CN113095840B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • G06Q20/4016Transaction verification involving fraud or risk level assessment in transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Data Mining & Analysis (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a method, a device and equipment for continuing a distributed transaction pending, which can improve the response speed and the processing efficiency of the pending transaction, release the load pressure of a relational database server and reduce the risk of a system based on a REDIS distributed transaction pending continuing method. The method comprises the following steps: firstly, calling a main transaction pending polling module, entering a pending node, then writing information of a target server and combined information of a pending thread ID of a current main transaction into a REDIS middleware through the transaction pending polling module, circularly reading the REDIS information, and deleting the combined information and the supplementary information on the REDIS middleware when judging that the combined information and the supplementary information both exist; and performing post-suspension service processing according to the supplementary information.

Description

Method, device and equipment for distributed transaction suspension continuous operation
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for distributed transaction suspension continuation.
Background
With the rapid development of social economy, various banks serve as financial service centers, and more customers transact various transaction businesses through the banks. The transaction suspension refers to dividing the transaction into two transactions, namely a main transaction and a sub transaction, wherein the main transaction is processed to a suspension node, and needs to wait in a thread manner to acquire the supplementary information uploaded by the sub transaction (initiated by other systems such as a bank card system); and after the main transaction acquires the information, continuing processing, and after the processing is finished, returning the result to the upstream system.
However, in the existing transaction suspension processing scheme, the main transaction is executed to the suspension link, and the relational database (such as oracle and the like) is read in a circulating manner to obtain the supplementary information sent by the sub-transaction (the sub-transaction stores the information in the database), so that under the condition of distributed high concurrency, the technical problems that the read-write efficiency of the relational database is low, the IO performance is bottleneck, the transaction processing is not timely, the database-based and table-based technologies cannot be used exist, and even the risk that the system operation is broken down and the user experience is influenced exist.
Disclosure of Invention
The embodiments of the present application mainly aim to provide a method, an apparatus, and a device for distributed transaction suspension continuation, which can improve the response speed and processing efficiency of a suspension transaction, release the load pressure of a relational database server, and reduce the system risk based on the REDIS-based distributed transaction suspension continuation method.
In a first aspect, an embodiment of the present application provides a method for a distributed transaction suspension, including:
s1: calling a main transaction pending polling module to enter a pending node;
s2: writing the information of the target server and the combined information of the suspended thread ID of the current main transaction into the REDIS middleware through a transaction suspended polling module;
s3: reading REDIS information in a circulating mode, and deleting the combined information and the supplementary information on the REDIS middleware when judging that the combined information and the supplementary information exist; and performing service processing after suspension according to the supplementary information.
Optionally, the method further includes:
calling a main transaction monitoring module to monitor the subject information of a target server in the REDIS middleware in real time; the subject information comprises combined information and supplementary information written into REDIS middleware by a sub-transaction processing module;
and extracting the suspended thread ID of the current main transaction according to the combined information, awakening the suspended thread according to the ID, and executing the step S3.
Optionally, after the writing, by the transaction pending polling module, the information of the target server and the combined information of the pending thread ID of the current main transaction into the REDIS middleware, the method further includes:
and setting the validity period of the key-value corresponding to the information of the target server and the suspended thread ID of the current main transaction in the REDIS middleware.
Optionally, the method further includes:
and circularly reading the REDIS information in the validity period, and deleting the information of the target server and the key-value corresponding to the suspended thread ID of the current main transaction in the REDIS middleware when judging that the combined information does not exist.
In a second aspect, an embodiment of the present application further provides a device for distributed transaction suspension continuation, including:
the first calling unit is used for calling the main transaction pending polling module to enter a pending node;
the write-in unit is used for writing the information of the target server and the combined information of the pending thread ID of the current main transaction into the REDIS middleware through the transaction pending polling module;
the processing unit is used for reading the REDIS information in a circulating way, and deleting the combined information and the supplementary information on the REDIS middleware when judging that the combined information and the supplementary information exist; and performing service processing after suspension according to the supplementary information.
Optionally, the apparatus further comprises:
the second calling unit is used for 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 comprises combined information and supplementary information written into REDIS middleware by a sub-transaction processing module;
and the third calling unit is used for extracting the suspended thread ID of the current main transaction according to the combined information, awakening the suspended thread according to the ID and calling and executing the processing unit.
Optionally, the apparatus further comprises:
and the setting unit is used for setting the validity period of the key-value corresponding to the information of the target server and the suspended thread ID of the current main transaction in the REDIS middleware after the combined information of the target server and the suspended thread ID of the current main transaction is written into the REDIS middleware through the transaction suspended polling module.
Optionally, the apparatus further comprises:
and the deleting unit is used for circularly reading the REDIS information in the validity period and deleting the key-value corresponding to the information of the target server and the suspended thread ID of the current main transaction in the REDIS middleware when judging that the combined information does not exist.
The embodiment of the present application further provides a device for continuing to make a distributed transaction suspension, including: a processor, a memory, a system bus;
the processor and the memory are connected through the system bus;
the memory is configured to store one or more programs, the one or more programs including instructions, which when executed by the processor, cause the processor to perform any one implementation of the method of distributed transaction suspension as described above.
An embodiment of the present application further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on a terminal device, the terminal device is caused to execute any implementation manner of the method for suspending continuation of distributed transaction.
The method, the device and the equipment for continuing the distributed transaction suspension provided by the embodiment of the application comprise the steps of calling a main transaction suspension polling module, entering a suspension node, writing information of a target server and combined information of a current suspension thread ID of a main transaction into a REDIS middleware through the transaction suspension polling module, circularly reading the REDIS information, and deleting the combined information and the supplementary information on the REDIS middleware when judging that the combined information and the supplementary information exist; and performing post-suspension service processing according to the supplementary information. Therefore, the distributed transaction suspension continuous operation method based on the REDIS can improve the response speed and the processing efficiency of the suspension transaction, release the load pressure of the relational database server and reduce the system risk.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a transaction of a conventional Zhongchang financial IC card system provided in an embodiment of the present application;
fig. 2 is a flowchart illustrating a method for suspending a distributed transaction according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a distributed transaction pending continuation system according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating a process of a distributed transaction suspension continuation at the master transaction suspension polling module side according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating a process of a distributed transaction suspension operation at the sub-transaction processing module side according to an embodiment of the present application;
fig. 6 is a schematic composition diagram of a distributed transaction pending continuation apparatus according to an embodiment of the present disclosure.
Detailed Description
In the banking industry, transaction suspension refers to dividing transactions into two transactions, namely a main transaction and a sub transaction, wherein the main transaction is processed to a suspension node, and needs to wait by a thread to acquire supplementary information uploaded by the sub transaction (initiated by other systems such as a bank card system); and after the main transaction acquires the information, continuing processing, and after the processing is finished, returning the result to the upstream system.
However, in the existing transaction suspension processing scheme, the main transaction is executed to the suspension link, and the relational database (such as oracle and the like) is read in a circulating manner to obtain the supplementary information sent by the sub-transaction (the sub-transaction stores the information in the database), so that under the condition of distributed high concurrency, the technical problems that the read-write efficiency of the relational database is low, the IO performance is bottleneck, the transaction processing is not timely, the database-based and table-based technologies cannot be used exist, and even the risk that the system operation is broken down and the user experience is influenced exist.
For example, the following steps are carried out: as shown in fig. 1, for the financial IC card system of the middle bank, its main function is inquiry and processing of two-dimensional code transaction. In the trade process of the merchant reverse-scanning local agent, a middle-bank merchant initiates main trade, a financial IC card system firstly performs business processing before suspension and initiates a trade request to a Unionpay, and the Unionpay immediately returns a synchronous response after receiving a consumption request; then the current main transaction is suspended, and the Unionpay system is waited to send a sub transaction 'C2B consumption result notice'; and after the main transaction acquires the supplementary information of the sub-transaction, the suspended business processing is carried out, and the result is returned to the upstream system. The main and sub transactions adopt a relational database oracle to realize information interaction. Circularly reading oracle from the main transaction processing to the temporary node to acquire the supplementary information, acquiring the supplementary information within limited time, continuing the transaction, and returning the result to the upstream system; if the supplementary information can not be obtained within the limited time, the transaction is refused overtime, and error information is returned to the upstream system. And the financial IC card system receives the sub-transactions sent by the Unionpay system, inserts the supplementary information into the relational database oracle, and finishes the information interaction of the main and sub-transactions after the main transaction is read.
It can be seen that, in the existing transaction suspension processing scheme, there are four problems: firstly, adopted relational database oracle to realize the information interaction of main and sub-transaction, read-write inefficiency, and caused the system can't adopt the technique of dividing the storehouse to divide the table, the huge volume of following the surge of transaction volume and data increases, IO performance bottleneck easily appears, arrests the operating efficiency of system. Secondly, the system adopts a centralized database, and cannot support rapid expansion of services and rapid expansion of the system. Thirdly, the main transaction adopts a mode of circularly polling database information, occupies database resources and influences the performance of other transactions. Fourthly, developers need to pay attention to the definition of the polling time interval; if the polling time interval is defined to be too short, the main transaction reads the database too frequently, a large amount of relational database resources are consumed, and insufficient memory and IO performance bottleneck are easy to occur; if the polling interval definition interval is too long, the main transaction processing time is too long, resulting in poor user experience.
In order to solve the above-mentioned defects, the embodiment of the present application provides a method for continuing a distributed transaction from scratch, which utilizes a high-performance key-value (key-value) memory database REDIS used to implement information interaction of main and sub transactions, thereby not only improving the information interaction efficiency of the main and sub transactions, but also releasing the load pressure of a relational database, and simultaneously supporting the distributed design of a system, fully enjoying the benefits brought by a database-sharing and table-sharing technology, and implementing quick capacity-expanding response of the system; meanwhile, the REDIS publish-subscribe function is utilized to realize the information interaction of the main transaction and the sub transaction at the zero time interval, so that developers do not need to pay excessive attention to the definition of the polling time interval.
The specific implementation process is as follows: firstly, calling a main transaction pending polling module, entering a pending node, then writing information of a target server and combined information of a pending thread ID of a current main transaction into a REDIS middleware through the transaction pending polling module, circularly reading the REDIS information, and deleting the combined information and the supplementary information on the REDIS middleware when judging that the combined information and the supplementary information both exist; and performing post-suspension service processing according to the supplementary information. Therefore, the distributed transaction suspension continuous operation method based on the REDIS can improve the response speed and the processing efficiency of the suspension transaction, release the load pressure of the relational database server and reduce the system risk.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
First embodiment
Referring to fig. 2, a flow chart of a method for suspending a distributed transaction according to this embodiment is schematically illustrated, where the method includes the following steps:
s1: and calling a main transaction pending polling module to enter a pending node.
In this embodiment, in order to improve the response speed and processing efficiency of the pending transaction, the load pressure of the relational database server is released, and the system risk is reduced. The application proposes to use REDIS to replace oracle as a main and sub transaction message interaction medium to form a new distributed transaction suspension continuing system, as shown in fig. 3, the system includes the following five modules: the main transaction suspension pre-business processing module and the main transaction suspension post-business processing module are used for receiving and responding to an upstream system message, performing business verification and logic processing before and after transaction suspension, and ensuring the correctness and the rationality of business. And the sub-transaction processing module is used for receiving messages sent by other systems, performing simple service processing, issuing theme messages to the REDIS message middleware and writing supplementary information of the main transaction. And thirdly, REDIS message middleware which is used for receiving the combination information written by the main transaction suspension polling module, the theme issued by the sub-transaction processing module and the written supplementary information. Fourthly, a main transaction monitoring module for monitoring the messages issued by the sub-transactions and actively waking up the thread of the main transaction; and after the main transaction is awakened, acquiring the supplementary information from the REDIS message middleware, and performing the next service processing. Fifthly, a main transaction suspension polling module is used for suspending current service processing and circularly reading REDIS within time limit to obtain supplementary information of the main transaction; if the information is acquired within the specified time, continuing the service processing; and refusing if the time is out.
On this basis, after receiving the main transaction of the pending transaction sent upstream, in order to implement the distributed transaction pending continuation, the system first needs to invoke the service processing module before the main transaction pending to perform simple logic check (e.g., check whether the personal account information is accurate or whether the merchant information is accurate), and then invokes the main transaction pending polling module to enter the pending node, as shown in fig. 4, so as to execute the subsequent step S2.
S2: and writing the information of the target server and the combined information of the suspended thread ID of the current main transaction into the REDIS middleware through the transaction suspended polling module.
In this embodiment, the master transaction pending polling module is called in step S1, and after entering the pending node, the transaction pending polling module further writes the information of the target server (e.g. the IP of the target server) and the combined information of the pending thread ID of the current master transaction into the REDIS middleware for executing the following step S3.
An alternative implementation manner is that after the information of the target server and the combined information of the pending thread ID of the current main transaction are written into the REDIS middleware through the transaction pending polling module, the information of the target server and the validity period of the key-value corresponding to the pending thread ID of the current main transaction may be set in the REDIS middleware to perform the subsequent step S3. Wherein the validity period is greater than the timeout time for the primary transaction.
S3: reading the REDIS information in a circulating manner, and deleting the combined information and the supplementary information on the REDIS middleware when judging that the combined information and the supplementary information exist; and performing post-suspension service processing according to the supplementary information.
In this embodiment, after the information of the target server and the combined information of the suspended thread ID of the current master transaction are written into the REDIS middleware in step S2, the REDIS information may be further read in a loop to determine whether the combined information and the supplemental information exist.
And circularly reading the REDIS information in the valid period, and deleting the information of the target server and the key-value corresponding to the suspended thread ID of the current main transaction in the REDIS middleware when judging that the combined information does not exist, wherein the condition indicates that the transaction is rejected due to overtime.
If the combined information exists but the supplementary information does not exist, the thread is suspended for a certain time, occupied server resources are released, the thread is suspended after a certain time, the combined information and the supplementary information are read and judged again, and the process is circulated.
If the combined information exists but the supplementary information exists, the circulation is ended, the combined information and the supplementary information on the REDIS middleware are deleted, and the after-hanging business processing is carried out according to the supplementary information.
In addition, an optional implementation manner is that the following steps a-B are also required to be performed:
step A: calling a main transaction monitoring module to monitor the subject information of a target server in the REDIS middleware in real time; wherein the subject information includes combination information and supplementary information written into the REDIS middleware by the sub-transaction processing module.
In this implementation, the relevant target server topics can be monitored in real time by calling the main transaction monitoring module of the system (as shown in fig. 4). And once the sub-transaction issues the information related to the target server theme, the main transaction monitoring module of the target server immediately responds, and acquires the combined information according to the issued information to execute the subsequent step B.
It should be noted that, in the present application, information of each server is unique, and it needs to be ensured that each server monitors different topics (the topics and the server information are bound one to one, and a one-to-many or many-to-one relationship does not occur), so as to achieve the purpose of reducing energy consumption of the server. Meanwhile, when REDIS is adopted as a main and sub transaction message interaction medium, the transaction information shared by the main and sub transactions is used as a key, and the uniqueness of the key is ensured, namely the key between the main transactions is uniquely determined, even the keys of multiple transactions of the same merchant are also uniquely determined.
And B: 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 performed.
In this implementation manner, if the main transaction monitoring module is called in step a to monitor in real time that there is no combination information in the subject information of the target server in the REDIS middleware, the monitoring processing logic is ended, and if the main transaction monitoring module is called in step a to monitor in real time that there is combination information in the subject information of the target server in the REDIS middleware, the suspended thread ID of the current main transaction can be extracted according to the combination information, and the suspended thread is awakened according to the ID, and step S3 is executed to perform post-suspended service processing according to the supplementary information.
It should be noted that, in order to improve the response speed and processing efficiency of the pending transaction, the load pressure of the relational database server is released, and the system risk is reduced. In this embodiment, as shown in fig. 5, after receiving the sub-transaction sent by the unionpay system, the sub-transaction processing module obtains the combined information from the REDIS according to the service main key, and if the combined information exists, writes the supplementary information of the main transaction into the REDIS, then extracts the information of the server from the combined information, and issues a message to the topic related to the server information. The main transaction monitoring module of each server monitors only the theme related to the server, and only responds to the information of the main transaction processed by the server, but not to the information of other servers, so that the pressure of server response can be greatly relieved.
Thus, by performing the above steps S1-S3, the following four objectives can be achieved: firstly, a non-relational database REDIS based on memory storage is used as a transmission medium for main and sub transaction information interaction, so that the information reading and writing speed is improved, and meanwhile, the access to a database server is greatly reduced. And secondly, the design of the whole processing system is not suspended any more, and for high-concurrency big data, a distributed design scheme of database division and table division can be adopted, so that the resource access pressure is reduced. Thirdly, by adopting a mode of subscription and polling, the main transaction can respond to the information provided by the sub-transactions within zero time, and the safety and the reliability of the system are ensured. And fourthly, by adopting a dynamic theme mode, the main transaction monitoring module corresponding to the current server only monitors the message of the theme of the current server, so that the monitoring frequency of the server is reduced, and the consumption of resources is reduced.
In summary, in the method for continuing a distributed transaction pending operation provided by this embodiment, a primary transaction pending polling module is first called, a pending node is entered, then, the information of a target server and the combined information of the pending thread ID of the current primary transaction are written into the REDIS middleware through the transaction pending polling module, then, the REDIS information is read in a loop, and when it is determined that both the combined information and the supplemental information exist, the combined information and the supplemental information in the REDIS middleware are deleted; and performing post-suspension service processing according to the supplementary information. Therefore, the distributed transaction suspension continuous operation method based on the REDIS can improve the response speed and the processing efficiency of the suspension transaction, release the load pressure of the relational database server and reduce the system risk.
Second embodiment
In this embodiment, a device for suspending a distributed transaction will be described, and for related contents, refer to the above method embodiment.
Referring to fig. 6, a schematic composition diagram of a distributed transaction suspension continuation apparatus provided in this embodiment is shown, where the apparatus includes:
a first calling unit 601, configured to call a master transaction pending polling module to enter a pending node;
a write-in unit 602, configured to write information of the target server and combination information of the pending thread ID of the current main transaction into the REDIS middleware through the transaction pending polling module;
the processing unit 603 is configured to read the REDIS information in a cyclic manner, and delete the combined information and the supplemental information in the REDIS middleware when it is determined that both the combined information and the supplemental information exist; and performing service processing after suspension according to the supplementary information.
In an implementation manner of this embodiment, the apparatus further includes:
the second calling unit is used for 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 comprises combined information and supplementary information written into REDIS middleware by a sub-transaction processing module;
and a third invoking unit, configured to extract a suspended thread ID of the current main transaction according to the combination information, wake up the suspended thread according to the ID, and invoke and execute the processing unit 603.
In an implementation manner of this embodiment, the apparatus further includes:
and the setting unit is used for setting the validity period of the key-value corresponding to the information of the target server and the suspended thread ID of the current main transaction in the REDIS middleware after the combined information of the target server and the suspended thread ID of the current main transaction is written into the REDIS middleware through the transaction suspended polling module.
In an implementation manner of this embodiment, the apparatus further includes:
and the deleting unit is used for circularly reading the REDIS information in the validity period and deleting the key-value corresponding to the information of the target server and the suspended thread ID of the current main transaction in the REDIS middleware when judging that the combined information does not exist.
In summary, in the distributed transaction pending continuation apparatus provided in this embodiment, first, the master transaction pending polling module is called to enter the pending node, then, the information of the target server and the combination information of the pending thread ID of the current master transaction are written into the REDIS middleware through the transaction pending polling module, then, the REDIS information is read in a loop, and when it is determined that both the combination information and the supplemental information exist, the combination information and the supplemental information in the REDIS middleware are deleted; and performing post-suspension service processing according to the supplementary information. Therefore, the distributed transaction suspension continuous operation method based on the REDIS can improve the response speed and the processing efficiency of the suspension transaction, release the load pressure of the relational database server and reduce the system risk.
Further, an embodiment of the present application further provides a device for continuing a distributed transaction suspension, including: a processor, a memory, a system bus;
the processor and the memory are connected through the system bus;
the memory is configured to store one or more programs, the one or more programs including instructions, which when executed by the processor, cause the processor to perform any of the methods of implementing the distributed transaction suspension.
Further, an embodiment of the present application further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the instructions cause the terminal device to execute any implementation method of the method for suspending a distributed transaction.
As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
It should be noted that, in the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for distributed transaction suspension continuation, comprising:
s1: calling a main transaction pending polling module to enter a pending node;
s2: writing the information of the target server and the combined information of the suspended thread ID of the current main transaction into the REDIS middleware through a transaction suspended polling module;
s3: reading REDIS information in a circulating mode, and deleting the combined information and the supplementary information on the REDIS middleware when judging that the combined information and the supplementary information exist; and performing service processing after suspension according to the supplementary information.
2. The method of claim 1, further comprising:
calling a main transaction monitoring module to monitor the subject information of a target server in the REDIS middleware in real time; the subject information comprises combined information and supplementary information written into REDIS middleware by a sub-transaction processing module;
and extracting the suspended thread ID of the current main transaction according to the combined information, awakening the suspended thread according to the ID, and executing the step S3.
3. The method of claim 1, wherein after the writing of the combination information of the target server and the pending thread ID of the current master transaction into the REDIS middleware by the transaction pending polling module, the method further comprises:
and setting the validity period of the key-value corresponding to the information of the target server and the suspended thread ID of the current main transaction in the REDIS middleware.
4. The method of claim 3, further comprising:
and circularly reading the REDIS information in the validity period, and deleting the information of the target server and the key-value corresponding to the suspended thread ID of the current main transaction in the REDIS middleware when judging that the combined information does not exist.
5. A distributed transaction pending continuation apparatus, comprising:
the first calling unit is used for calling the main transaction pending polling module to enter a pending node;
the write-in unit is used for writing the information of the target server and the combined information of the pending thread ID of the current main transaction into the REDIS middleware through the transaction pending polling module;
the processing unit is used for reading the REDIS information in a circulating way, and deleting the combined information and the supplementary information on the REDIS middleware when judging that the combined information and the supplementary information exist; and performing service processing after suspension according to the supplementary information.
6. The apparatus of claim 5, further comprising:
the second calling unit is used for 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 comprises combined information and supplementary information written into REDIS middleware by a sub-transaction processing module;
and the third calling unit is used for extracting the suspended thread ID of the current main transaction according to the combined information, awakening the suspended thread according to the ID and calling and executing the processing unit.
7. The apparatus of claim 5, further comprising:
and the setting unit is used for setting the validity period of the key-value corresponding to the information of the target server and the suspended thread ID of the current main transaction in the REDIS middleware after the combined information of the target server and the suspended thread ID of the current main transaction is written into the REDIS middleware through the transaction suspended polling module.
8. The apparatus of claim 7, further comprising:
and the deleting unit is used for circularly reading the REDIS information in the validity period and deleting the key-value corresponding to the information of the target server and the suspended thread ID of the current main transaction in the REDIS middleware when judging that the combined information does not exist.
9. A distributed transaction pending continuation device, comprising: a processor, a memory, a system bus;
the processor and the memory are connected through the system bus;
the memory is to store one or more programs, the one or more programs comprising instructions, which when executed by the processor, cause the processor to perform the method of any of claims 1-4.
10. A computer-readable storage medium having stored therein instructions that, when executed on a terminal device, cause the terminal device to perform the method of any one of claims 1-4.
CN202110486307.7A 2021-04-30 2021-04-30 Method, device and equipment for suspending continuous operation of distributed transaction Active CN113095840B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110486307.7A CN113095840B (en) 2021-04-30 2021-04-30 Method, device and equipment for suspending continuous operation of distributed transaction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110486307.7A CN113095840B (en) 2021-04-30 2021-04-30 Method, device and equipment for suspending continuous operation of distributed transaction

Publications (2)

Publication Number Publication Date
CN113095840A true CN113095840A (en) 2021-07-09
CN113095840B CN113095840B (en) 2024-09-27

Family

ID=76681230

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110486307.7A Active CN113095840B (en) 2021-04-30 2021-04-30 Method, device and equipment for suspending continuous operation of distributed transaction

Country Status (1)

Country Link
CN (1) CN113095840B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090248803A1 (en) * 2008-03-28 2009-10-01 Fujitsu Limited Apparatus and method of analyzing service processing status
KR20180033994A (en) * 2016-09-27 2018-04-04 삼성생명보험주식회사 User equipment and server for providing user authentication documents
CN109741165A (en) * 2018-12-18 2019-05-10 中信百信银行股份有限公司 A kind of data processing method and electronic equipment of financial system
CN110580258A (en) * 2019-09-20 2019-12-17 中国银行股份有限公司 big data free query method and device
US20200265050A1 (en) * 2019-02-15 2020-08-20 Hitachi, Ltd. Database management system and database management method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090248803A1 (en) * 2008-03-28 2009-10-01 Fujitsu Limited Apparatus and method of analyzing service processing status
KR20180033994A (en) * 2016-09-27 2018-04-04 삼성생명보험주식회사 User equipment and server for providing user authentication documents
CN109741165A (en) * 2018-12-18 2019-05-10 中信百信银行股份有限公司 A kind of data processing method and electronic equipment of financial system
US20200265050A1 (en) * 2019-02-15 2020-08-20 Hitachi, Ltd. Database management system and database management method
CN110580258A (en) * 2019-09-20 2019-12-17 中国银行股份有限公司 big data free query method and device

Also Published As

Publication number Publication date
CN113095840B (en) 2024-09-27

Similar Documents

Publication Publication Date Title
CN101222348B (en) Method and system for calculating number of website real user
CN102831156B (en) Distributed transaction processing method on cloud computing platform
CN104598459B (en) database processing, data access method and system
CN108874587B (en) Method and system for guaranteeing final consistency of affairs
CN101089857A (en) Internal store data base transaction method and system
CN107527222B (en) Information processing method, device and system
CN112053149A (en) Method and device for preventing repeated payment, electronic equipment and readable storage medium
CN111324622A (en) Resource first-aid-purchase processing method, device, equipment and storage medium
CN113095840B (en) Method, device and equipment for suspending continuous operation of distributed transaction
CN111125168B (en) Data processing method and device, electronic equipment and storage medium
JP3844933B2 (en) Database server processing method
CN116739524A (en) Business process setting method, device, equipment, storage medium and program product
CN110417899B (en) Communication method and system of host and platform server
CN114844907A (en) Bank transaction high-speed low-connection-number implementation method based on MQ asynchronous receiving and transmitting
CN113391933A (en) Method for processing fund
CN113762857A (en) Inventory deduction method, device, equipment and storage medium
CN112162988A (en) Distributed transaction processing method and device and electronic equipment
CN112950171A (en) Bank business processing system and method
CN111611104A (en) InfluxDB data backup method, system and terminal equipment
CN106375354B (en) Data processing method and device
CN111459931A (en) Data duplication checking method and data duplication checking device
CN115756768B (en) Distributed transaction processing method, device, equipment and medium based on saga
CN112118294B (en) Request processing method, device and medium based on server cluster
US20220303219A1 (en) Non-transitory computer-readable recording medium, service management device, and service management method
CN115994045A (en) Transaction hosting method and device based on shared storage database cluster

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant