Transaction callback method and device, electronic equipment and computer program product

By responding to transaction callback requests in the financial business system, determining the target callback transaction and obtaining or calling the corresponding tag or name according to its environment, the problem of low recognition accuracy when distinguishing transactions that require callbacks is solved, and the accuracy and consistency of transaction callbacks are achieved.

CN119739469APending Publication Date: 2025-04-01INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411782594.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the prior art, the recognition accuracy rate is low when distinguishing transactions that require callbacks, which may cause unreliable problems when switching between production environments and disaster recovery environments, affecting business operations.

Method used

By responding to transaction callback requests, determine the target callback transaction and obtain or call the corresponding callback tag or transaction name according to its application environment (production environment or disaster recovery environment), thereby achieving accurate transaction callbacks.

Benefits of technology

Improve the accuracy of identifying transactions that need to be called, ensure transaction consistency in the disaster recovery drill state, and reduce the occurrence of erroneous operations and unreliable problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739469A_ABST
    Figure CN119739469A_ABST
Patent Text Reader

Abstract

The invention discloses a transaction callback method and device, electronic equipment and a computer program product. Relates to the field of financial science and technology, and the method comprises the steps: responding to a transaction callback request, and determining a target callback transaction according to the transaction callback request, the target callback transaction being a transaction used for maintaining the consistency of transaction requests; the application environment of the target callback transaction is determined, and the application environment comprises a production environment and a disaster recovery environment; when the application environment of the target callback transaction is the disaster recovery environment, obtaining a callback label of the target callback transaction, and calling the target callback transaction from the disaster recovery environment by using the callback label; and under the condition that the application environment of the target callback transaction is the production environment, determining a transaction name of the target callback transaction, and calling the target callback transaction according to the transaction name. According to the method and the device, the technical problem of low recognition accuracy when the transaction needing to be called back is distinguished in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology, and specifically, to a transaction callback method, device, electronic device and computer program product. Background Art

[0002] Since financial services often involve the coordinated operation of multiple services or systems, there is a need for cross-system interaction, which makes financial services more complex. In order to smoothly execute financial services, it is necessary to ensure that the operations associated with financial services meet atomicity, consistency, isolation and persistence. Therefore, distributed transaction management technology plays a vital role. In the disaster recovery drill scenario, the transactions participating in the drill need to interact with the distributed transaction platform. At the end of the disaster recovery drill, the transaction will be switched back from the disaster recovery environment to the production environment, and compensation requirements will be generated when taking over all business traffic.

[0003] For example, if a transaction needs compensation during a disaster recovery drill, the transaction platform needs to locate the transaction in the disaster recovery environment, rather than the service of the same name in the production environment. In the relevant technology, the developer first makes an environmental judgment, then calls the transaction from the disaster recovery environment obtained by the judgment, and finally realizes the compensation of the transaction. The above method is to judge the environment by the developer adding judgment logic in the program, and then use the judgment logic to determine whether the current environment is a production environment or a disaster recovery environment, and choose to call the compensation service interface of the production or disaster recovery environment. However, in the actual operation process, the names of the transactions in the production environment and the disaster recovery environment are similar, and the names of the compensation service interface of the production environment and the compensation service interface of the disaster recovery environment also have the same problem. If the developer makes a mistake or neglects to call the compensation service interface of the wrong environment, it is easy to cause production errors, and there are unreliable problems in emergency switching scenarios, which affects the operation of the business.

[0004] With respect to the technical problem of low recognition accuracy when distinguishing transactions requiring callback in related technologies, no effective solution has been proposed yet. Summary of the invention

[0005] The main purpose of the present application is to provide a transaction callback method, device, electronic device and computer program product to solve the technical problem of low recognition accuracy when distinguishing transactions that need to be callback in the related art.

[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a transaction callback method is provided. The method comprises: responding to a transaction callback request, determining a target callback transaction according to the transaction callback request, wherein the target callback transaction refers to a transaction used to maintain the consistency of the transaction request; determining the application environment of the target callback transaction, wherein the application environment includes a production environment and a disaster recovery environment; when the application environment of the target callback transaction is the disaster recovery environment, obtaining a callback tag of the target callback transaction, and calling the target callback transaction from the disaster recovery environment using the callback tag; when the application environment of the target callback transaction is the production environment, determining a transaction name of the target callback transaction, and calling the target callback transaction according to the transaction name.

[0007] Furthermore, before responding to the transaction callback request, the method also includes: when the production environment is in a disaster recovery drill state, obtaining a main transaction in the production environment, and obtaining M sub-transactions associated with the main transaction, wherein the main transaction refers to the initiator of the transaction request, each sub-transaction is used to execute the transaction request, and M is a positive integer; when there are N sub-transactions with execution exceptions among the M sub-transactions, L sub-transactions among the N sub-transactions with execution exceptions are transferred to the disaster recovery environment, and NL sub-transactions are retained in the production environment, wherein L is less than or equal to N, N is less than M, and L and N are positive integers.

[0008] Furthermore, determining the application environment of the target callback transaction includes: extracting environment configuration items from the target callback transaction, and determining the initial application environment according to the environment configuration items; obtaining the running logic of the target callback transaction, and verifying the initial application environment according to the running logic to obtain the application environment, wherein the running logic at least includes a network interface, a domain name, and a connection status with a preset service associated with the target callback transaction when it is running.

[0009] Furthermore, obtaining the callback tag of the target callback transaction includes: obtaining the callback tag of the target callback transaction from a database, wherein the callback tag in the database is determined in the following manner: when the application environment of the target callback transaction is the disaster recovery environment, the transaction framework tool obtains a tag naming rule, determines a preset tag according to the tag naming rule, modifies the preset tag according to the transaction name to obtain the callback tag, and stores the callback tag and the transaction name in the database.

[0010] Furthermore, after the target callback transaction is called from the disaster recovery environment using the callback tag, the method further includes: initiating transaction compensation for the target callback transaction according to the callback tag.

[0011] Further, initiating transaction compensation for the target callback transaction according to the callback tag includes: obtaining the transaction status of the target callback transaction, wherein the transaction status includes a service suspension status and a service running status; when the transaction status is the service suspension status, keeping the transaction status unchanged; when the transaction status is the service running status, revoking the running data of the target callback transaction and rolling back the target callback transaction.

[0012] Furthermore, after initiating transaction compensation for the target callback transaction according to the callback tag, the method further includes: obtaining a processing result of the transaction compensation, and ending the transaction compensation when the processing result indicates that the transaction compensation is completed; and initiating a compensation instruction when the processing result indicates that the transaction compensation fails, wherein the compensation instruction is used to prompt the operation and maintenance object to perform compensation, and the operation and maintenance object performs compensation in a manner including executing the transaction compensation based on the application environment after selecting the application environment of the target callback transaction.

[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a transaction callback device is provided. The device includes: a response unit, which is used to respond to a transaction callback request, and determine a target callback transaction according to the transaction callback request, wherein the target callback transaction refers to a transaction used to maintain the consistency of the transaction request; a first determination unit, which is used to determine the application environment of the target callback transaction, wherein the application environment includes a production environment and a disaster recovery environment; a first acquisition unit, which is used to obtain a callback tag of the target callback transaction when the application environment of the target callback transaction is the disaster recovery environment, and use the callback tag to call the target callback transaction from the disaster recovery environment; a second determination unit, which is used to determine a transaction name of the target callback transaction when the application environment of the target callback transaction is the production environment, and call the target callback transaction according to the transaction name.

[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored executable program, wherein when the executable program is running, a callback method for controlling the device where the computer-readable storage medium is located to execute any of the above-mentioned transactions.

[0015] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory stores an executable program, and the processor is used to run the program, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement a callback method for any one of the above-mentioned transactions.

[0016] According to another aspect of an embodiment of the present invention, a computer program product is further provided. The computer program product includes a computer program. When the computer program is executed by a processor, the callback method of any one of the above transactions is implemented.

[0017] In an embodiment of the present application, a transaction callback method is adopted, and a target callback transaction is determined according to the transaction callback request by responding to a transaction callback request, wherein the target callback transaction refers to a transaction used to maintain the consistency of the transaction request; an application environment of the target callback transaction is determined, wherein the application environment includes a production environment and a disaster recovery environment; when the application environment of the target callback transaction is the disaster recovery environment, a callback tag of the target callback transaction is obtained, and the target callback transaction is called from the disaster recovery environment using the callback tag; when the application environment of the target callback transaction is the production environment, a transaction name of the target callback transaction is determined, and the target callback transaction is called according to the transaction name, thereby achieving the purpose of ensuring transaction consistency in a disaster recovery drill state, thereby achieving the effect of improving the accuracy of identifying transactions that need to be called, and further solving the technical problem of low recognition accuracy when distinguishing transactions that need to be called back. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a callback method of a transaction;

[0020] Figure 2 is a flowchart of a transaction callback method provided according to an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of a non-disaster recovery drill state provided according to an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of an optional transaction callback method provided according to an embodiment of the present application;

[0023] Figure 5 is a schematic diagram of a transaction callback device provided according to an embodiment of the present application;

[0024] Figure 6 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0028] It should be noted that the collected information used in this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse to use it.

[0029] Example 1

[0030] According to an embodiment of the present application, a method embodiment of transaction callback is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0031] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 It is a hardware structure diagram of a computer terminal (or mobile device) for implementing a callback method of a transaction, such as Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more ( Figure 1 102a, 102b, ..., 102n are used to illustrate) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU (Microcontroller Unit) or a programmable logic device FPGA (Field-Programmable Gate Array)), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a keyboard, a cursor control device, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0032] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0033] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the callback method of the transaction in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the callback method of the transaction described above is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0034] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC) and a network interface, which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0035] The display may be, for example, a touch screen liquid crystal display that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0036] Under the above operating environment, this application provides Figure 2 The callback method for the transaction shown. Figure 2 is a flowchart of a transaction callback method provided according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0037] Step S201, responding to a transaction callback request, and determining a target callback transaction according to the transaction callback request, wherein the target callback transaction refers to a transaction used to maintain consistency of the transaction request.

[0038] Specifically, target callback transactions are used for applications that have a direct impact on business continuity in disaster recovery or business continuity plans. Figure 3 is a schematic diagram of a non-disaster recovery drill state provided according to an embodiment of the present application, such as Figure 3As shown, when the production environment is operating normally, multiple transactions including target callback transactions are running in the production environment, and these transactions process actual business requests, such as processing financial transaction business; when the production environment encounters force majeure factors and becomes unavailable, it is necessary to switch the services in the production environment to the disaster recovery environment, so as to reduce the interruption time and reduce data loss. At this time, the disaster recovery environment can assume the role of the production environment after the switch and take over the actual business traffic until the main environment returns to normal, thereby ensuring service continuity and data security. Among them, the production environment refers to the actual environment that provides services to users and the formal operation of the software system. The distributed transaction platform is used to coordinate all transactions and ensure the consistency of distributed transactions.

[0039] Therefore, in order to ensure service consistency in a disaster recovery environment, the distributed transaction platform needs to perform callback processing on related transactions. At this time, the distributed transaction platform can receive standard transaction callback requests that require callback processing, and then determine the target callback transaction involved based on the request.

[0040] It should be noted that transaction callback requests, as a key mechanism in distributed transaction processing, can maintain the consistency and atomicity of transactions. For example, when a transaction is executed and any abnormality is detected, the transaction operation that has been performed can be undone according to the transaction callback request. During disaster recovery drills or actual switching, when it is necessary to switch transactions between the production environment and the disaster recovery environment, the transaction callback request can be made to the service of the current environment to perform the corresponding transaction maintenance operations.

[0041] Step S202: determining the application environment of the target callback transaction, wherein the application environment includes a production environment and a disaster recovery environment.

[0042] Specifically, after the distributed transaction platform determines the target callback transaction, it is necessary to determine the application environment in which the transaction is located so that different callback operations can be performed according to the application environment.

[0043] It should be noted that the production environment refers to an environment where transactions are formally run and services are provided to users. It can provide functions to the outside world, process real data, and respond to user requests, and has high availability, performance, and security requirements. The disaster recovery environment (DRE) established as a backup of the production environment contains the same or similar software and data as the production environment. It is mainly used for disaster recovery testing and drills. Under normal circumstances, it is not directly facing users and does not process user requests. When the main production environment fails, data is lost, or other unforeseen events occur, it quickly takes over services until the main environment returns to normal, to ensure business continuity and data security, and to minimize business interruption time and data loss.

[0044] Step S203, when the application environment of the target callback transaction is a disaster recovery environment, obtain the callback tag of the target callback transaction, and use the callback tag to call the target callback transaction from the disaster recovery environment.

[0045] Specifically, in order to solve the problem that the distributed transaction platform cannot accurately call transactions in the disaster recovery environment during the disaster recovery drill, the distributed transaction platform can use the callback tag of the target callback transaction as the query condition, and then locate the target callback transaction with the callback tag from the platform to implement the calling operation.

[0046] Step S204: when the application environment of the target callback transaction is the production environment, determine the transaction name of the target callback transaction, and call the target callback transaction according to the transaction name.

[0047] Specifically, when the target calling transaction that needs to be called back has not been transferred to the disaster recovery environment, that is, the target callback transaction is in the production environment, the distributed transaction platform can directly call the transaction according to the transaction name of the target callback transaction.

[0048] The transaction callback method provided in the embodiment of the present application responds to a transaction callback request, determines a target callback transaction according to the transaction callback request, wherein the target callback transaction refers to a transaction used to maintain the consistency of the transaction request; determines an application environment of the target callback transaction, wherein the application environment includes a production environment and a disaster recovery environment; when the application environment of the target callback transaction is a disaster recovery environment, obtains a callback tag of the target callback transaction, and uses the callback tag to call the target callback transaction from the disaster recovery environment; when the application environment of the target callback transaction is a production environment, determines a transaction name of the target callback transaction, and calls the target callback transaction according to the transaction name, thereby solving the technical problem of low recognition accuracy when distinguishing transactions that need to be called back in the related art, and by determining the target callback transaction and the application environment of the transaction, and then performing different transaction callback operations based on the application environment, thereby achieving the effect of improving the accuracy of identifying transactions that need to be called.

[0049] Optionally, in the transaction callback method provided in an embodiment of the present application, before responding to the transaction callback request, the method also includes: when the production environment is in a disaster recovery drill state, obtaining a main transaction in the production environment, and obtaining M sub-transactions associated with the main transaction, wherein the main transaction refers to the initiator of the transaction request, each sub-transaction is used to execute the transaction request, and M is a positive integer; when there are N sub-transactions with execution exceptions among the M sub-transactions, L sub-transactions among the N sub-transactions with execution exceptions are transferred to the disaster recovery environment, and NL sub-transactions are retained in the production environment, wherein L is less than or equal to N, N is less than M, and L and N are positive integers.

[0050] Specifically, the main transaction is the source of initiating a transaction request, and the subtransaction is the unit that executes specific business logic. Each subtransaction is responsible for processing part of the transaction request. When the production environment is running normally, if a business transaction is required, the main transaction as the initiator of the business transaction can register the transaction information with the distributed transaction platform, and then the distributed transaction platform calls each subtransaction according to the transaction information. When the production environment enters the disaster recovery drill state, that is, when simulating a failure state, one or more subtransactions can fail when running subtransactions. At this time, some or all of the above subtransactions need to be redirected to the disaster recovery environment, and the remaining subtransactions continue to be set in the production environment. Furthermore, after the above-mentioned failed subtransactions are redirected, the distributed transaction platform can call back one or more subtransactions at this time to ensure the consistency of the transaction.

[0051] It should be noted that when redirecting subtransactions, the selection method of subtransactions can be to evaluate the recoverability of each abnormal subtransaction, that is, whether the compensation operation can be performed accurately in the disaster recovery environment; evaluate the current load and resource availability of the disaster recovery environment to avoid overloading or resource shortage of the disaster recovery environment due to the transfer of a large number of subtransactions; and evaluate the correlation and dependency between subtransactions to ensure that the transferred subtransactions can cooperate with each other and no new problems will be caused by the transfer of isolated subtransactions. This embodiment transfers subtransactions so that when the production environment is in a disaster recovery drill state, it can solve the problem of distributed transaction consistency, improve the recovery capability in the event of a failure, and optimize resource utilization, avoid overloading the disaster recovery environment, and ensure the efficiency and effectiveness of the disaster recovery drill.

[0052] Optionally, in the transaction callback method provided in an embodiment of the present application, determining the application environment of the target callback transaction includes: extracting environment configuration items from the target callback transaction, and determining the initial application environment based on the environment configuration items; obtaining the running logic of the target callback transaction, and verifying the initial application environment based on the running logic to obtain the application environment, wherein the running logic includes at least the network interface, domain name, and connection status with the preset service associated with the target callback transaction when it is running.

[0053] Specifically, environment configuration items refer to information that can help the distributed transaction platform identify and locate the application environment of the target callback transaction. These configuration items can be identified by the distributed transaction platform to distinguish the application environment. That is, when the distributed transaction platform determines the target callback service, it can first extract these environment configuration items from the target callback transaction, and perform preliminary identification of the application environment based on the environment configuration items to obtain the initial application environment. For example, the target callback transaction communicates with the distributed transaction platform through a specific network interface and domain name. This information is the environment configuration items.

[0054] Furthermore, since the operation logic of a transaction not only includes the business process and transaction rules of the transaction, but also involves the network, services, data resources, etc. that the transaction relies on during execution, the distributed transaction platform can further obtain the operation logic of the target callback transaction after obtaining the environment configuration item, and verify whether these logics match the initial environment configuration. When the operation logic matches the initial application environment, it can be determined that the application environment of the target callback transaction is the above-mentioned initial application environment. The verification method of the distributed transaction platform can be to check the network interface and domain name used by the target callback transaction at runtime, and confirm whether they match the information recorded in the current environment configuration item to verify whether the transaction was initially run in the production environment or the disaster recovery environment; evaluate the connection status of the target callback transaction with the preset service (such as database, message queue) at runtime to ensure that the transaction can correctly access and utilize the required service resources to support the compensation operation of the transaction; analyze the context information of the transaction, including transaction ID, participant information, transaction status, etc., to further confirm the original environment and operation conditions of the transaction to ensure the accuracy of the compensation operation.

[0055] This embodiment extracts the environment configuration items of the target callback transaction, and then verifies the transaction running logic, thereby accurately determining the application environment of the target callback transaction, ensuring that the compensation operation is performed based on the correct environment configuration and transaction status, reducing the risk of compensation operation failure caused by environment configuration errors or transaction logic mismatch, and improving the accuracy and efficiency of transaction recovery.

[0056] In order to distinguish different transactions in a disaster recovery environment, optionally, in the transaction callback method provided in an embodiment of the present application, obtaining the callback tag of the target callback transaction includes: obtaining the callback tag of the target callback transaction from a database, wherein the callback tag in the database is determined in the following manner: when the application environment of the target callback transaction is a disaster recovery environment, the transaction framework tool obtains a tag naming rule, determines a preset tag according to the tag naming rule, modifies the preset tag according to the transaction name to obtain a callback tag, and stores the callback tag and the transaction name in the database.

[0057] The transaction framework tool can be a transaction architecture SDK (Software Development Kit). In order to distinguish different transactions in a disaster recovery environment, the transaction framework tool can set labels for transactions in the disaster recovery environment. Specifically, after obtaining the label naming rule used to characterize the label setting method in the disaster recovery environment, the transaction framework tool determines the preset label according to the rule. The above rule can be to add a specific prefix or suffix to the transaction name of the original transaction, such as "Backup" or "DR". When the label naming rule is to add the suffix "_Backup" to the transaction name, the preset label is "_Backup".

[0058] After determining the preset tag, the transaction framework tool combines the transaction name of the target callback transaction in the disaster recovery environment with the preset tag to generate the final callback tag, and finally associates the callback tag and the transaction name, and stores it in the database of the distributed transaction platform. When the distributed transaction platform needs to call the target callback transaction, it can obtain the callback tag related to the transaction from the database, and then accurately call the target callback transaction in the disaster recovery environment. Even in the complex situation of switching back and forth between the production environment and the disaster recovery environment, it can avoid transaction compensation failures or data inconsistencies that may be caused by environmental confusion. This embodiment ensures the accurate distinction between the production environment and the disaster recovery environment services by adding specific callback tags to the transaction services of the disaster recovery environment, and storing and querying them in the distributed transaction platform, thereby enhancing the accuracy and reliability of transaction compensation operations and improving transaction processing efficiency and data security during disaster recovery switching.

[0059] In order to ensure the consistency of distributed transactions and business continuity, optionally, in the transaction callback method provided in the embodiment of the present application, after calling the target callback transaction from the disaster recovery environment using the callback tag, the method also includes: initiating transaction compensation for the target callback transaction according to the callback tag.

[0060] Specifically, transaction compensation operations in a disaster recovery environment can quickly respond to transaction anomalies, reduce transaction recovery time, and thus restore business consistency and integrity. Therefore, when the transaction platform successfully calls the target callback transaction through the callback tag, it can evaluate the current state of the transaction, for example, whether the transaction has been completed, whether the transaction is in a compensation state, whether the transaction requires further compensation operations, etc., and then determine the appropriate compensation strategy based on the transaction state and business needs, where the compensation strategy can be full compensation, partial compensation, forced compensation, delayed compensation, etc.

[0061] Furthermore, the distributed transaction platform performs corresponding compensation logic according to the above supplementary strategy to restore the consistency of the transaction. This embodiment uses the callback tag to call the target callback transaction from the disaster recovery environment, and initiates accurate transaction compensation according to the callback tag, which can avoid compensation failures or consistency problems that may be caused by environmental identification errors or inaccurate transaction positioning. At the same time, the introduction of transaction compensation can provide a more flexible and efficient transaction processing solution for disaster recovery drills, optimize disaster recovery strategies, and improve the effectiveness of disaster recovery drills.

[0062] Optionally, in the transaction callback method provided in an embodiment of the present application, initiating transaction compensation for the target callback transaction according to the callback tag includes: obtaining the transaction status of the target callback transaction, wherein the transaction status includes a service suspension status and a service running status; when the transaction status is a service suspension status, keeping the transaction status unchanged; when the transaction status is a service running status, revoking the running data of the target callback transaction, and rolling back the target callback transaction.

[0063] It should be noted that in the scenario of switching back and forth between the production environment and the disaster recovery environment, compensating the target callback transaction can ensure the consistency of distributed transactions and the integrity of the data. Transaction compensation means that when an exception or failure occurs in the transaction, the entire transaction is rolled back to the initial state, thereby avoiding data inconsistency or business logic errors. For example, if any sub-operation in the transaction fails and the remaining operations have been completed, the data state will be inconsistent. The compensation mechanism can be used to revoke the completed operations, ensure the synchronization of the data states of all transactions, and restore the consistency of transactions.

[0064] Specifically, when compensating the target callback transaction, the transaction state of the target callback transaction can be determined first. When the above transaction represents a suspended state, there is no need to perform transaction compensation; on the contrary, when the transaction is running normally, it can be revoked or rolled back by performing the opposite operation, so as to recover to a stable state. For example, if the target callback transaction is a financial transaction, the method of compensating the transaction can be to revoke data, restore data to the state before the transaction, roll back the service state of the change sent to before the transaction started, release the resources occupied during the runtime, etc. This embodiment can ensure that the business function corresponding to the transaction is not affected by performing transaction compensation on the target callback transaction, thereby building a more stable and efficient data processing and disaster recovery system, enhancing its ability to cope with various emergencies, and ensuring business continuity.

[0065] Optionally, in the transaction callback method provided in an embodiment of the present application, after initiating transaction compensation for the target callback transaction according to the callback tag, the method further includes: obtaining a processing result of the transaction compensation, and ending the transaction compensation when the processing result indicates that the transaction compensation is completed; and initiating a compensation instruction when the processing result indicates that the transaction compensation has failed, wherein the compensation instruction is used to prompt the operation and maintenance object to perform compensation, and the way in which the operation and maintenance object performs compensation includes executing transaction compensation based on the application environment after selecting the application environment of the target callback transaction.

[0066] Specifically, when a transaction cannot be compensated due to various reasons (such as network delays, service unavailability), the distributed transaction platform can also provide a manual compensation mechanism. That is, when the result of the transaction compensation indicates that the transaction compensation has failed, the operation and maintenance object can be allowed to intervene by sending compensation instructions. The operation and maintenance object can then choose whether to call the service of the production environment or disaster recovery environment to perform the compensation operation based on the specific situation.

[0067] It should be noted that the above-mentioned compensation mechanism can display a detailed list of compensation failures through a user interface or an API (Application Programming Interface) interface, in which the current status of the transaction and the environment involved are displayed. At this time, the operation and maintenance object can select a specific application environment and specify whether the compensation is performed by a service instance in the production environment or the disaster recovery environment. After the operation and maintenance object selects a service instance, the distributed transaction platform can generate a compensation request associated with the corresponding environment tag and send it to the target service instance, which finally performs the compensation operation. This embodiment obtains the processing results of transaction compensation and determines whether transaction compensation needs to be re-performed based on the results. This not only improves the automation level and efficiency of transaction processing, but also enhances the system's disaster recovery capabilities and fault recovery capabilities, providing a strong technical guarantee for building a stable and reliable disaster recovery system.

[0068] This embodiment also provides a transaction callback method. Figure 4 is a schematic diagram of an optional transaction callback method provided according to an embodiment of the present application, such as Figure 4 As shown, the method includes:

[0069] When the production environment is in a disaster recovery drill state, the target callback transaction is in the disaster recovery environment, and the remaining transactions are in the production environment. The target callback transaction and the transaction in the production environment can implement financial transaction operations by initiating transaction requests to the distributed transaction platform. When there are transactions with abnormal execution in the above transactions, in order to ensure the consistency of the transactions, the distributed transaction platform needs to determine the target callback transaction according to the callback tag and send a transaction callback request to it, so as to implement the transaction compensation operation of the target callback transaction based on the request. This embodiment determines the target callback transaction and the application environment of the transaction, and then performs different transaction callback operations based on the application environment, thereby achieving the effect of improving the accuracy of identifying the transaction that needs to be called.

[0070] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0071] Example 2

[0072] The embodiment of the present application also provides a transaction callback device. It should be noted that the transaction callback device of the embodiment of the present application can be used to execute the transaction callback method provided by the embodiment of the present application. The transaction callback device provided by the embodiment of the present application is introduced below.

[0073] According to an embodiment of the present application, a device for implementing the callback method of the above transaction is also provided. Figure 5 is a schematic diagram of a transaction callback device provided according to an embodiment of the present application, such as Figure 5 As shown, the device includes: a responding unit 50, a first determining unit 51, a first acquiring unit 52, and a second determining unit 53.

[0074] A response unit 50 is used to respond to the transaction callback request and determine a target callback transaction according to the transaction callback request, wherein the target callback transaction refers to a transaction used to maintain consistency of the transaction request;

[0075] A first determining unit 51 is used to determine an application environment of a target callback transaction, wherein the application environment includes a production environment and a disaster recovery environment;

[0076] The first acquisition unit 52 is used to acquire the callback tag of the target callback transaction when the application environment of the target callback transaction is a disaster recovery environment, and use the callback tag to call the target callback transaction from the disaster recovery environment;

[0077] The second determining unit 53 is configured to determine a transaction name of the target callback transaction when the application environment of the target callback transaction is a production environment, and call the target callback transaction according to the transaction name.

[0078] The transaction callback device provided by the embodiment of the present application responds to the transaction callback request through the response unit 50, and determines the target callback transaction according to the transaction callback request, wherein the target callback transaction refers to the transaction used to maintain the consistency of the transaction request; the first determination unit 51 determines the application environment of the target callback transaction, wherein the application environment includes the production environment and the disaster recovery environment; the first acquisition unit 52 acquires the callback tag of the target callback transaction when the application environment of the target callback transaction is the disaster recovery environment, and calls the target callback transaction from the disaster recovery environment using the callback tag; the second determination unit 53 determines the transaction name of the target callback transaction when the application environment of the target callback transaction is the production environment, and calls the target callback transaction according to the transaction name, thereby solving the technical problem of low recognition accuracy when distinguishing transactions that need to be called back in the related art, and by determining the target callback transaction and the application environment of the transaction, different transaction callback operations are performed based on the application environment, thereby achieving the effect of improving the accuracy of identifying transactions that need to be called.

[0079] Optionally, in the transaction callback device provided in the embodiment of the present application, the device also includes: a second acquisition unit, used to obtain the main transaction in the production environment before responding to the transaction callback request, when the production environment is in a disaster recovery drill state, and obtain M sub-transactions associated with the main transaction, wherein the main transaction refers to the initiator of the transaction request, each sub-transaction is used to execute the transaction request, and M is a positive integer; a transfer unit, used to transfer L sub-transactions of the N sub-transactions with abnormal execution to the disaster recovery environment when there are N sub-transactions with abnormal execution among the M sub-transactions, and retain NL sub-transactions in the production environment, wherein L is less than or equal to N, N is less than M, and L and N are positive integers.

[0080] Optionally, in the callback device of the transaction provided in the embodiment of the present application, the first determination unit 51 includes: an extraction module, used to extract environment configuration items from the target callback transaction, and determine the initial application environment according to the environment configuration items; a first acquisition module, used to obtain the running logic of the target callback transaction, verify the initial application environment according to the running logic, and obtain the application environment, wherein the running logic at least includes the network interface, domain name and connection status with the preset service associated with the target callback transaction when it is running.

[0081] Optionally, in the transaction callback device provided in the embodiment of the present application, the first acquisition unit 52 includes: a second acquisition module, used to obtain the callback tag of the target callback transaction from the database, wherein the callback tag in the database is determined in the following manner: when the application environment of the target callback transaction is a disaster recovery environment, the transaction framework tool obtains the tag naming rule, determines the preset tag according to the tag naming rule, modifies the preset tag according to the transaction name to obtain the callback tag, and stores the callback tag and the transaction name in the database.

[0082] Optionally, in the transaction callback device provided in the embodiment of the present application, the device also includes: a first initiating unit, configured to initiate transaction compensation for the target callback transaction according to the callback tag after calling the target callback transaction from the disaster recovery environment using the callback tag.

[0083] Optionally, in the transaction callback device provided in the embodiment of the present application, the first acquisition unit 52 includes: a third acquisition module, used to obtain the transaction status of the target callback transaction, wherein the transaction status includes a service suspension status and a service running status; a maintaining module, used to keep the transaction status unchanged when the transaction status is a service suspension status; and a canceling module, used to cancel the running data of the target callback transaction and roll back the target callback transaction when the transaction status is a service running status.

[0084] Optionally, in the transaction callback device provided in the embodiment of the present application, the device also includes: a third acquisition unit, used to obtain a processing result of the transaction compensation after initiating transaction compensation for the target callback transaction according to the callback tag, and end the transaction compensation when the processing result indicates that the transaction compensation is completed; a second initiating unit, used to initiate a compensation instruction when the processing result indicates that the transaction compensation has failed, wherein the compensation instruction is used to prompt the operation and maintenance object to perform compensation, and the way in which the operation and maintenance object performs compensation includes performing transaction compensation based on the application environment after selecting the application environment of the target callback transaction.

[0085] It should be noted that the above-mentioned response unit 50, first determination unit 51, first acquisition unit 52, and second determination unit 53 correspond to steps S201 to S204 in Example 1, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned units can also be part of the device and can be run in the computer terminal 10 provided in Example 1.

[0086] Example 3

[0087] The embodiment of the present application may provide a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal or an electronic device.

[0088] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.

[0089] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the callback method of the transaction: responding to the transaction callback request, determining the target callback transaction according to the transaction callback request, wherein the target callback transaction refers to a transaction used to maintain the consistency of the transaction request; determining the application environment of the target callback transaction, wherein the application environment includes the production environment and the disaster recovery environment; when the application environment of the target callback transaction is the disaster recovery environment, obtaining the callback tag of the target callback transaction, and calling the target callback transaction from the disaster recovery environment using the callback tag; when the application environment of the target callback transaction is the production environment, determining the transaction name of the target callback transaction, and calling the target callback transaction according to the transaction name.

[0090] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the callback method of the transaction: when the production environment is in a disaster recovery drill state, obtain the main transaction in the production environment, and obtain M sub-transactions associated with the main transaction, wherein the main transaction refers to the initiator of the transaction request, each sub-transaction is used to execute the transaction request, and M is a positive integer; when there are N sub-transactions with execution exceptions among the M sub-transactions, transfer L sub-transactions among the N sub-transactions with execution exceptions to the disaster recovery environment, and retain NL sub-transactions in the production environment, wherein L is less than or equal to N, N is less than M, and L and N are positive integers.

[0091] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the callback method of the transaction: extracting environment configuration items from the target callback transaction, and determining the initial application environment according to the environment configuration items; obtaining the running logic of the target callback transaction, and verifying the initial application environment according to the running logic to obtain the application environment, wherein the running logic at least includes the network interface, domain name and connection status with the preset service associated when the target callback transaction is running.

[0092] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the transaction callback method: obtaining the callback tag of the target callback transaction from the database, wherein the callback tag in the database is determined in the following manner: when the application environment of the target callback transaction is a disaster recovery environment, the transaction framework tool obtains the tag naming rule, determines the preset tag according to the tag naming rule, modifies the preset tag according to the transaction name to obtain the callback tag, and stores the callback tag and the transaction name in the database.

[0093] Optionally, the computer terminal may execute the following program code of the transaction callback method: initiating transaction compensation for the target callback transaction according to the callback tag.

[0094] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the transaction callback method: obtaining the transaction status of the target callback transaction, wherein the transaction status includes a service suspension status and a service running status; when the transaction status is a service suspension status, keeping the transaction status unchanged; when the transaction status is a service running status, revoking the running data of the target callback transaction and rolling back the target callback transaction.

[0095] Optionally, the computer terminal may execute the following program codes of the following steps in the transaction callback method: obtaining the processing result of the transaction compensation, and ending the transaction compensation when the processing result indicates that the transaction compensation is completed; initiating a compensation instruction when the processing result indicates that the transaction compensation has failed, wherein the compensation instruction is used to prompt the operation and maintenance object to perform compensation, and the operation and maintenance object performs compensation in a manner including performing transaction compensation based on the application environment after selecting the application environment of the target callback transaction.

[0096] Optionally, Figure 6 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 6 As shown, the electronic device may include: one or more ( Figure 6 (only one is shown) processor 602, memory 604, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0097] Among them, the memory can be used to store software programs and modules, such as the callback method of the transaction in the embodiment of the present application and the program instructions / modules corresponding to the device. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the callback method of the above-mentioned transaction. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0098] The processor may call the information and application program stored in the memory through the transmission device to execute the above steps in the callback method of the above transaction.

[0099] By adopting the embodiment of the present application, a solution for transaction callback is provided. By responding to a transaction callback request, a target callback transaction is determined according to the transaction callback request, wherein the target callback transaction refers to a transaction used to maintain the consistency of the transaction request; the application environment of the target callback transaction is determined, wherein the application environment includes a production environment and a disaster recovery environment; when the application environment of the target callback transaction is a disaster recovery environment, the callback tag of the target callback transaction is obtained, and the target callback transaction is called from the disaster recovery environment using the callback tag; when the application environment of the target callback transaction is a production environment, the transaction name of the target callback transaction is determined, and the target callback transaction is called according to the transaction name, thereby achieving the purpose of ensuring transaction consistency in the disaster recovery drill state, and further solving the technical problem of low recognition accuracy when distinguishing transactions that need to be called back.

[0100] It can be understood by those skilled in the art that Figure 6 The structure shown is for illustration only, and the electronic device may also be a smart phone, a tablet computer, a PDA, a mobile Internet device (MID), a PAD or other terminal device. Figure 6 The structure of the electronic device is not limited. Figure 6 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 6 Different configurations are shown.

[0101] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0102] Example 4

[0103] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the callback method of the transaction provided in the first embodiment.

[0104] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0105] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: responding to a transaction callback request, determining a target callback transaction according to the transaction callback request, wherein the target callback transaction refers to a transaction used to maintain consistency of the transaction request; determining an application environment of the target callback transaction, wherein the application environment includes a production environment and a disaster recovery environment; when the application environment of the target callback transaction is a disaster recovery environment, obtaining a callback tag of the target callback transaction, and calling the target callback transaction from the disaster recovery environment using the callback tag; when the application environment of the target callback transaction is a production environment, determining a transaction name of the target callback transaction, and calling the target callback transaction according to the transaction name.

[0106] Optionally, the storage medium is also configured to store program code for executing the following steps: when the production environment is in a disaster recovery drill state, obtain a main transaction in the production environment, and obtain M sub-transactions associated with the main transaction, wherein the main transaction refers to the initiator of the transaction request, each sub-transaction is used to execute the transaction request, and M is a positive integer; when there are N sub-transactions with execution exceptions among the M sub-transactions, transfer L sub-transactions among the N sub-transactions with execution exceptions to the disaster recovery environment, and retain NL sub-transactions in the production environment, wherein L is less than or equal to N, N is less than M, and L and N are positive integers.

[0107] Optionally, the storage medium is also configured to store program code for executing the following steps: extracting environment configuration items from the target callback transaction, and determining the initial application environment based on the environment configuration items; obtaining the running logic of the target callback transaction, and verifying the initial application environment based on the running logic to obtain the application environment, wherein the running logic includes at least the network interface, domain name, and connection status with the preset service associated with the target callback transaction when it is running.

[0108] Optionally, the storage medium is also configured to store program code for executing the following steps: obtaining a callback tag of a target callback transaction from a database, wherein the callback tag in the database is determined in the following manner: when the application environment of the target callback transaction is a disaster recovery environment, the transaction framework tool obtains a tag naming rule, determines a preset tag according to the tag naming rule, modifies the preset tag according to the transaction name to obtain a callback tag, and stores the callback tag and the transaction name in the database.

[0109] Optionally, the storage medium is further configured to store a program code for executing the following steps: initiating transaction compensation for the target callback transaction according to the callback tag.

[0110] Optionally, the storage medium is also configured to store program code for executing the following steps: obtaining the transaction status of the target callback transaction, wherein the transaction status includes a service pause status and a service running status; when the transaction status is a service pause status, keeping the transaction status unchanged; when the transaction status is a service running status, revoking the running data of the target callback transaction and rolling back the target callback transaction.

[0111] Optionally, the storage medium is also configured to store program codes for executing the following steps: obtaining a processing result of transaction compensation, and ending the transaction compensation when the processing result indicates that the transaction compensation is complete; initiating a compensation instruction when the processing result indicates that the transaction compensation has failed, wherein the compensation instruction is used to prompt the operation and maintenance object to perform compensation, and the operation and maintenance object performs compensation in a manner that includes performing transaction compensation based on the application environment after selecting an application environment for the target callback transaction.

[0112] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the steps of the callback method of a transaction.

[0113] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0114] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0115] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0118] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.

[0119] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A transaction callback method, characterized in that: Applied to distributed transaction platforms, including: In response to the transaction callback request, a target callback transaction is determined according to the transaction callback request, wherein the target callback transaction refers to a transaction used to maintain consistency of the transaction request; Determining an application environment of the target callback transaction, wherein the application environment includes a production environment and a disaster recovery environment; When the application environment of the target callback transaction is the disaster recovery environment, obtaining a callback tag of the target callback transaction, and calling the target callback transaction from the disaster recovery environment using the callback tag; In a case where the application environment of the target callback transaction is the production environment, a transaction name of the target callback transaction is determined, and the target callback transaction is called according to the transaction name.

2. The method according to claim 1, characterized in that Before responding to the transaction callback request, the method further includes: When the production environment is in a disaster recovery drill state, a main transaction in the production environment is obtained, and M subtransactions associated with the main transaction are obtained, wherein the main transaction refers to an initiator of the transaction request, each subtransaction is used to execute the transaction request, and M is a positive integer; In the case that there are N sub-transactions with execution exceptions among the M sub-transactions, L sub-transactions among the N sub-transactions with execution exceptions are transferred to the disaster recovery environment, and NL sub-transactions are retained in the production environment, where L is less than or equal to N, N is less than M, and L and N are positive integers.

3. The method according to claim 1, characterized in that Determining the application environment of the target callback transaction includes: Extracting environment configuration items from the target callback transaction, and determining an initial application environment according to the environment configuration items; The operation logic of the target callback transaction is obtained, and the initial application environment is verified according to the operation logic to obtain the application environment, wherein the operation logic at least includes a network interface, a domain name, and a connection status with a preset service associated with the target callback transaction when it is running.

4. The method according to claim 1, characterized in that: Obtaining the callback tag of the target callback transaction includes: Obtaining a callback tag of the target callback transaction from a database, wherein the callback tag in the database is determined in the following manner: a transaction framework tool obtains a tag naming rule when the application environment of the target callback transaction is the disaster recovery environment, determines a preset tag according to the tag naming rule, modifies the preset tag according to the transaction name to obtain the callback tag, and stores the callback tag and the transaction name in the database.

5. The method according to claim 1, characterized in that: After invoking the target callback transaction from the disaster recovery environment using the callback tag, the method further includes: Initiate transaction compensation for the target callback transaction according to the callback tag.

6. The method according to claim 5, characterized in that Initiating transaction compensation for the target callback transaction according to the callback tag includes: Acquire the transaction status of the target callback transaction, wherein the transaction status includes a service suspension status and a service running status; When the transaction state is the service suspension state, keeping the transaction state unchanged; When the transaction state is the service running state, the running data of the target callback transaction is cancelled, and a rollback operation is performed on the target callback transaction.

7. The method according to claim 5, characterized in that After initiating transaction compensation for the target callback transaction according to the callback tag, the method further includes: Acquiring a processing result of the transaction compensation, and ending the transaction compensation when the processing result indicates that the transaction compensation is completed; In the case where the processing result indicates that the transaction compensation fails, a compensation instruction is initiated, wherein the compensation instruction is used to prompt the operation and maintenance object to perform compensation, and the operation and maintenance object performs compensation in a manner including selecting an application environment of the target callback transaction and then executing the transaction compensation based on the application environment.

8. A transaction callback device, characterized in that: include: A response unit, used to respond to a transaction callback request, and determine a target callback transaction according to the transaction callback request, wherein the target callback transaction refers to a transaction used to maintain consistency of the transaction request; A first determining unit, configured to determine an application environment of the target callback transaction, wherein the application environment includes a production environment and a disaster recovery environment; A first acquisition unit is configured to acquire a callback tag of the target callback transaction when the application environment of the target callback transaction is the disaster recovery environment, and to call the target callback transaction from the disaster recovery environment using the callback tag; The second determining unit is configured to determine a transaction name of the target callback transaction when the application environment of the target callback transaction is the production environment, and call the target callback transaction according to the transaction name.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the computer-readable storage medium is located is controlled to execute the transaction callback method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: A memory storing an executable program; A processor is used to run the program, wherein the program executes the callback method of the transaction described in any one of claims 1 to 7 when running.

11. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the transaction callback method described in any one of claims 1 to 7 are implemented.