CN113515352A - Distributed transaction different-base mode inverse transaction calling method and device - Google Patents

Distributed transaction different-base mode inverse transaction calling method and device Download PDF

Info

Publication number
CN113515352A
CN113515352A CN202110540794.0A CN202110540794A CN113515352A CN 113515352 A CN113515352 A CN 113515352A CN 202110540794 A CN202110540794 A CN 202110540794A CN 113515352 A CN113515352 A CN 113515352A
Authority
CN
China
Prior art keywords
transaction
information
sub
main
gray level
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
CN202110540794.0A
Other languages
Chinese (zh)
Other versions
CN113515352B (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110540794.0A priority Critical patent/CN113515352B/en
Publication of CN113515352A publication Critical patent/CN113515352A/en
Application granted granted Critical
Publication of CN113515352B publication Critical patent/CN113515352B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a distributed transaction different-library mode inverse transaction calling method and a device, which can be used in the field of distributed technology, and the method comprises the following steps: the client side main transaction side generates main transaction information, the main transaction information is registered to the server side to obtain a main transaction ID, an RPC call request is initiated after the registration is successful, a gray level flow label is set in the RPC call request, and a corresponding client side transaction side gray level provider is searched according to the gray level flow label; the client terminal transaction side acquires the sub-transaction information and the attribute information of the gray level flow label according to the RPC call request, and registers the sub-transaction information to the server side according to the main transaction ID to obtain the sub-transaction ID; and in the process of calling the sub-transaction business method, initiating an information updating request to the server when the client terminal transaction side throws an exception. The invention can simplify the operation complexity and realize the full link gray scale.

Description

Distributed transaction different-base mode inverse transaction calling method and device
Technical Field
The invention relates to the technical field of distribution, in particular to a distributed transaction different-base mode inverse transaction calling method and device.
Background
In distributed transactions, the saga model is widely applied to banking financial institutions due to the characteristics that the performance business process does not lock database resources, the operation is performed according to the transaction process sequence and the performance is high. The model is based on forward compensation, a transaction is provided with a plurality of participants, each participant is provided with a forward operation (T) and a reverse compensation operation (C), the forward operation (T) of each participant is executed in the business process, and the reverse operation (C) of the previous consistency participant is compensated when failure occurs. Before each forward operation (T), the remote transaction manager is required to register transaction information, the forward operation (T) execution is finished, a request for updating the transaction state is sent to the remote transaction manager for updating the transaction state, and if the transaction state fails or is abnormal, the remote transaction manager initiates a call (C) of a reverse transaction method.
In order to support the grayscale version test point function of the transaction application and provide the reliability of version release, the transaction framework needs to support the full link grayscale. At present, the mode of supporting the gray scale in the heterogeneous library mode is mainly to apply an additional cluster, so that the gray scale service is separately deployed into one cluster, the additional service management burden is brought to the application by the additional cluster, the operation complexity is increased, and meanwhile, the gray scale of only a single node cannot be realized on a full link.
Therefore, there is a need for a distributed transaction variant base mode inverse transaction invocation scheme that overcomes the above-mentioned problems.
Disclosure of Invention
The embodiment of the invention provides a distributed transaction different-library mode inverse transaction calling method, which is used for simplifying operation complexity and realizing full-link gray scale and comprises the following steps:
the client side generates main transaction information;
the client side registers the main transaction information to a server side to obtain a main transaction ID;
after the registration is successful, a client side main transaction side initiates an RPC call request, wherein a gray level flow label is set in the RPC call request;
the client main transaction side searches the corresponding client terminal transaction side gray level provider according to the gray level flow label;
the client terminal transaction side acquires sub-transaction information and attribute information of the gray level flow label according to the RPC call request;
the client side business side registers the sub-business information to the server side according to the main business ID to obtain a sub-business ID;
in the process of calling the sub-transaction business method, when the client terminal transaction side throws an exception, an information updating request is initiated to the server side, the information updating request is used for the server side to update main transaction information and sub-transaction information, all sub-transactions under the main transaction are inquired according to the main transaction ID, a callback interface registered by a gray level provider is searched according to the attribute information of a gray level flow label, and the distributed transaction exception mode reverse transaction calling is carried out according to the callback interface.
The embodiment of the invention provides a distributed transaction different-library mode inverse transaction calling device, which is used for simplifying operation complexity and realizing full-link gray scale and comprises the following components:
the information generation module is used for generating main transaction information by the main transaction side of the client;
the first information registration module is used for registering the main transaction information to a server side by a client side to obtain a main transaction ID;
the call request initiating module is used for initiating an RPC call request at a main transaction side of the client after the registration is successful, and a gray level flow label is set in the RPC call request;
the provider searching module is used for searching the corresponding client terminal transaction side gray level provider by the client main transaction side according to the gray level flow label;
the information acquisition module is used for the client terminal transaction side to acquire the sub-transaction information and the attribute information of the gray level flow label according to the RPC call request;
the second information registration module is used for the client side to register the sub-transaction information to the server side according to the main transaction ID to obtain the sub-transaction ID;
and the update request initiating module is used for initiating an information update request to the server when the client terminal transaction side throws an exception in the process of calling the sub-transaction service method, wherein the information update request is used for inquiring all sub-transactions under the main transaction according to the ID of the main transaction after the main transaction information and the sub-transaction information are updated by the server, searching a callback interface registered by a gray level provider according to the attribute information of the gray level flow label, and calling the distributed transaction exception-based mode reverse transaction according to the callback interface.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the distributed transaction heterogeneous library mode inverse transaction calling method.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program for executing the distributed transaction heterogeneous library mode inverse transaction calling method.
The embodiment of the invention generates the main transaction information through the main transaction side of the client; the client side registers the main transaction information to a server side to obtain a main transaction ID; after the registration is successful, a client side main transaction side initiates an RPC call request, wherein a gray level flow label is set in the RPC call request; the client main transaction side searches the corresponding client terminal transaction side gray level provider according to the gray level flow label; the client terminal transaction side acquires sub-transaction information and attribute information of the gray level flow label according to the RPC call request; the client side business side registers the sub-business information to the server side according to the main business ID to obtain a sub-business ID; in the process of calling the sub-transaction business method, when the client terminal transaction side throws an exception, an information updating request is initiated to the server side, the information updating request is used for the server side to update main transaction information and sub-transaction information, all sub-transactions under the main transaction are inquired according to the main transaction ID, a callback interface registered by a gray level provider is searched according to the attribute information of a gray level flow label, and the distributed transaction exception mode reverse transaction calling is carried out according to the callback interface. According to the embodiment of the invention, when the client terminal transaction side throws an exception, an information updating request is initiated to the server side, after the server side updates the main transaction information and the sub-transaction information, all sub-transactions under the main transaction are inquired according to the main transaction ID, and the callback interface registered by the gray level provider is searched according to the attribute information of the gray level flow label, so that complicated operations such as adding a service cluster for a version test point and reducing service management are not required, the operation complexity is effectively simplified, and the full link gray level is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a diagram illustrating a distributed transaction variant base mode inverse transaction calling method according to an embodiment of the present invention;
FIGS. 2-3 are schematic diagrams illustrating a distributed transaction variant-base mode inverse transaction invocation flow in an embodiment of the invention;
FIG. 4 is a diagram of a distributed transaction library mode anti-transaction calling device in accordance with an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
As previously described, in order to support the grayscale version point function of a transaction application, providing reliability of version release, the transaction framework needs to support full link grayscale. At present, the mode of supporting the gray scale in the heterogeneous library mode is mainly to apply an additional cluster, so that the gray scale service is separately deployed into one cluster, the additional service management burden is brought to the application by the additional cluster, the operation complexity is increased, and meanwhile, the gray scale of only a single node cannot be realized on a full link. Therefore, the heterogeneous library model saga needs to support full-link gray scale release to support upgrading and modification of different versions, and a correct provider can be matched when the reverse compensation method (C) is called back.
In order to simplify the operation complexity and implement full-link grayscale, an embodiment of the present invention provides a distributed transaction library-based mode inverse transaction calling method, as shown in fig. 1, where the method may include:
step 101, a client side generates main transaction information;
step 102, a client side master transaction side registers the master transaction information to a server side to obtain a master transaction ID;
103, after the registration is successful, a client side master transaction side initiates an RPC call request, wherein a gray level flow label is set in the RPC call request;
104, the main transaction side of the client side searches a corresponding gray level provider at the transaction side of the client side according to the gray level flow label;
105, the client terminal transaction side acquires sub-transaction information and attribute information of the gray level flow label according to the RPC call request;
step 106, the client terminal transaction side registers the sub-transaction information to the server side according to the main transaction ID to obtain a sub-transaction ID;
and 107, in the process of calling the sub-transaction service method, initiating an information updating request to the server when the client terminal transaction side throws an exception, wherein the information updating request is used for inquiring all sub-transactions under the main transaction according to the ID of the main transaction after the main transaction information and the sub-transaction information are updated by the server, searching a callback interface registered by a gray level provider according to the attribute information of the gray level flow label, and calling the distributed transaction exception library mode reverse transaction according to the callback interface.
As shown in fig. 1, in the embodiment of the present invention, the master transaction information is generated by the master transaction side of the client; the client side registers the main transaction information to a server side to obtain a main transaction ID; after the registration is successful, a client side main transaction side initiates an RPC call request, wherein a gray level flow label is set in the RPC call request; the client main transaction side searches the corresponding client terminal transaction side gray level provider according to the gray level flow label; the client terminal transaction side acquires sub-transaction information and attribute information of the gray level flow label according to the RPC call request; the client side business side registers the sub-business information to the server side according to the main business ID to obtain a sub-business ID; in the process of calling the sub-transaction business method, when the client terminal transaction side throws an exception, an information updating request is initiated to the server side, the information updating request is used for the server side to update main transaction information and sub-transaction information, all sub-transactions under the main transaction are inquired according to the main transaction ID, a callback interface registered by a gray level provider is searched according to the attribute information of a gray level flow label, and the distributed transaction exception mode reverse transaction calling is carried out according to the callback interface. According to the embodiment of the invention, when the client terminal transaction side throws an exception, an information updating request is initiated to the server side, after the server side updates the main transaction information and the sub-transaction information, all sub-transactions under the main transaction are inquired according to the main transaction ID, and the callback interface registered by the gray level provider is searched according to the attribute information of the gray level flow label, so that complicated operations such as adding a service cluster for a version test point and reducing service management are not required, the operation complexity is effectively simplified, and the full link gray level is realized.
The inventor finds that in order to reduce the deployment complexity of the application gray version as much as possible in the saga mode and realize flexible deployment of the gray nodes in the transaction link, the saga mode needs to have the capability of supporting the gray of the full link. In the saga mode, whether an RPC call request has a gray label or not needs to be judged before the orthogonal easy logic execution of the sub-transaction and is recorded in a database of a remote transaction manager, when the transaction is abnormal, whether the transaction has the gray label or not is inquired before a reverse compensation service method called back by the transaction manager, if so, the gray label is marked on the request before the reverse compensation service is called back, and therefore the correct compensation service call-back inlet can be found through the matching search of a service frame.
In the embodiment, a client main transaction side generates main transaction information, the client main transaction side registers the main transaction information to a server to obtain a main transaction ID, the client main transaction side initiates an RPC call request after the registration is successful, a gray flow label is set in the RPC call request, the client main transaction side searches a corresponding client terminal transaction side gray level provider according to the gray flow label, the client terminal transaction side obtains sub-transaction information and attribute information of the gray flow label according to the RPC call request, and the client terminal transaction side registers the sub-transaction information to the server according to the main transaction ID to obtain the sub-transaction ID.
In this embodiment, searching for the grayscale provider of the sub-transaction corresponding to the main transaction according to the grayscale flow label includes:
matching the gray level flow labels with gray level marks preset by a plurality of providers;
and determining the gray level provider of the sub-transaction corresponding to the main transaction according to the matching result.
In the embodiment, in the process of calling the sub-transaction service method, an information updating request is initiated to a server side when a client side transaction side throws an exception, the information updating request is used for inquiring all sub-transactions under a main transaction according to the ID of the main transaction after the main transaction information and the sub-transaction information are updated by the server side, a callback interface registered by a gray level provider is searched according to the attribute information of a gray level flow label, and a distributed transaction exception mode reverse transaction calling is carried out according to the callback interface.
In this embodiment, the information update request is used for the server to update the main transaction information and the sub-transaction information, and includes:
and the information updating request is used for updating the main transaction information into a compensation state and updating the sub-transaction information into a call failure state by the server.
In this embodiment, initiating an information update request to the server when the client transaction side throws an exception includes:
when the client side transaction side throws an exception to the main transaction side, the main transaction side initiates an information updating request to the server side.
In this embodiment, the method for invoking the distributed transaction heterogeneous library mode inverse transaction further includes: and registering the main transaction state information, the gray label attribute and the corresponding sub-transaction state information into a transaction log storage database.
FIG. 2 is a system diagram of a distributed transaction library model inverse transaction call, which includes a Local Transaction Manager (LTM), a Remote Transaction Manager (RTM), a Gray scale Processor (Gray Processor), and a transaction log storage Database (DB). A transaction has a plurality of transaction participants, wherein a transaction initiator is used as a main transaction, the transaction participants are used as sub-transactions, each sub-transaction has a life (C) with a forward method (T) and a reverse compensation method, the forward operation (T) is initiated by the main transaction, and the reverse compensation operation (C) is initiated by a server when the transaction needs to be rolled back. Among them, Local Transaction Manager (LTM): create and update transactions and send RPC call requests to register and update transaction information to saga's Remote Transaction Manager (RTM), which manages the transfer and recovery of local transaction context. Remote transaction manager (Remote transaction manager, RTM): and the system is responsible for processing RPC call requests sent by the LTM and registering or updating transaction information to a server-side database. And for the failed transaction needing compensation, inquiring a sub-transaction list in the database according to the main transaction ID, and calling back the applied compensation service according to the service group, the compensation method information and the like in the inquired sub-transaction. Transaction log storage Database (DB): the RTM stores a database of transaction information, storing main transaction information and sub-transaction information. Grayscale Processor (Gray Processor): and checking whether the information of the gray label which is set by the call or is required to be transmitted downwards by the upper layer call exists on the call link or not during each RPC call, and if so, marking the gray label on the request flow before the PRC call so as to enable the request flow to be transmitted downwards on the call link. And meanwhile, the module is responsible for marking the gray level mark for the gray level service when the full-link gray level service is published and finding the gray level service according to the label matching contained in the RPC calling request when the service is subscribed. In short, the method is responsible for transparent transmission of the gray label on a calling link, setting of a gray mark of service release and service matching search during service subscription.
The following provides a specific embodiment, which illustrates a distributed transaction heterogeneous library mode inverse transaction calling scheme in the embodiment of the present invention. As shown in fig. 3, the transaction initiator S invokes the gray scale service of transaction participant a and the service of transaction participant B. Transaction a has a normal provider and a grayscale provider and belongs to the same service group. Within the service of transaction a an orthogonal easy method (T) and a reverse compensation method (C) are defined. The orthogonal easy service method is called by a transaction initiator, the reverse compensation method (C) is started by a transaction framework according to the execution state judgment of the main transaction, the LTM reports that the state of updating the main transaction is failure, the RTM inquires all sub-transactions below the main transaction in a database, and the calling of the reverse compensation method (C) of the sub-transactions is started. If the reverse compensation method of each sub-transaction is called, the service to which the sub-transaction belongs needs to be subscribed, and for the RTM, thousands of services need to be subscribed, so that the service subscription management is complex. Therefore, for convenience of management, each service group is specified to register a callback service according to a set rule based on the service group name, the RTM generates a service name according to the same rule and subscribes to the callback service according to the service group name of the transaction a queried by the database when calling back the compensation method of the sub-transaction a, and returns the compensation method name when calling back the service. The callback service is that a service group searches for an entry of a real compensation method, after the entry enters the entry, the compensation method name returned during RTM callback finds information such as parameters of the corresponding compensation method stored in a memory during a service starting stage, and the information is called to the real compensation method C by reflection. If the transaction a registers the normal service and the gray level service at the same time, because the normal service and the gray level service share one service group, the registered callback service name is also the same, but the gray level service has a gray level node mark in a full link gray level scene, the RTM can mark the flow during callback according to the gray level label stored in the transaction a, and the correct gray level service provider is matched.
Specifically, each node on the call link has a Gray Processor, and the Gray Processor is matched to the Gray provider for RPC call request filtering through the component. Assuming such a calling scenario, transaction participant S calls the grayscale service of transaction participant a and calls the normal service of B.
1. When a transaction starts, the transaction initiator S first generates a main transaction by the LTM of the initiator S, and calls a registration transaction information service provided by the RTM through the RPC to register the main transaction information to a transaction database of the server, and registers the main transaction as a CREATE state. The following grayscale sub-transaction a and sub-transaction B are then invoked in sequence.
2. S calls Gray scale service of sub-transaction A (the Gray scale mark of the service set by Gray Processor is arranged at the side of the service provider), before A is called, LTM of S calls the Gray Processor of S to make Gray scale flow label for RPC calling request of A, when PRC request of A is matched and searched for Gray scale provider of A, the service is matched and searched according to the flow label of RPC request and the Gray scale mark of the provider, and the Gray scale provider of A is called.
3. After step 2 matches find the gray provider of a, the transaction link up flow goes to node a. Firstly, a sub-transaction A is created and generated by the LTM of A, and meanwhile, a Gray label contained in a PRC calling request sent by a Gray Processor analysis upper link is called and set as the Gray label attribute of the transaction A, and the Gray label attribute and other information of the sub-transaction A are registered and persisted to a server database. And if the registration is successful, the LTM initiates the calling of the business method of the transaction A, if the exception is thrown out in the business method of the calling A or the business logic detects that the exception actively utilizes the provided tool class and fails, the sub-transaction A throws the exception and gives the exception to the main transaction layer, asynchronously initiates RPC calling, and calls a service interface provided by the RTM to update the sub-transaction information to START _ FAILED.
4. And (3) the LTM of the main transaction layer receives the exception thrown by the transaction A in the step (3), synchronously calls an update main transaction state interface provided by the RTM through the RPC, updates the main transaction state to a COMPENSATE state, throws the exception into the transaction S and terminates the transaction flow, and does not execute the sub-transaction B. After receiving the failure update request of the main transaction S, the RTM updates the transaction state in the database and starts the rollback of the whole transaction.
5. The rollback procedure for transaction S is as follows: the RTM queries the sub-transaction under the transaction S according to the transaction ID to obtain a sub-transaction list, and finds that there is a sub-transaction a under it that needs to be compensated. And judging that the sub-transaction A is a Gray level service according to the Gray level label attribute information of the sub-transaction A, and calling a Gray Processor by the RTM to mark a Gray level flow label for the RPC request when a compensation callback interface provided by the RPC callback A is used. Meanwhile, the bottom layer of the remote server side also utilizes Gray Processor matching to search the callback interface registered by the Gray level provider during service matching search, and after a correct callback inlet is found, other information of the compensation method can be found in the memory and the compensation method is called.
The above process only describes the case when the gray level service a is invoked unsuccessfully, assuming that the gray level service a is invoked successfully, the transaction initiator S invokes B sequentially after invoking a, the B transaction invocation failure RTM checks two sub-transactions in the sub-transaction list when rolling back the transactions, and rolls back the bottle opener transactions sequentially in reverse order, and the roll back process is also similar to that shown above. Every time when the RPC calls the request, the Gray Processor is responsible for filtering, matching and searching the service when the bottom layer searches for the provider, if the RPC calls the request and marks a Gray label, if the Gray provider is not found when the provider with the corresponding Gray label is found in a matching manner, the service is degraded, and the service without the label is called. The LTM of the sub-transaction a described above calls the RTM service with a service degradation process, although there is a label in the traffic when the RPC calls the RTM service, to the RTM-provided service without the gray scale flag. And because each RPC calls the Gray Processor, the Gray label transmitted by the upper link and the label set by the upper link are transmitted, the full link Gray function on the transaction link can be realized.
The embodiment of the invention provides a different-library mode inverse transaction calling scheme based on a full-link gray scene, aiming at solving the problem of gray version release of distributed transaction application service in a transaction framework based on a saga mode. The transaction frame analyzes the Gray label in the RPC call request received by the service provider side and stores the Gray label in the server side database, the stored Gray label information is taken out when the callback is compensated, if the label information exists, the Gray label is marked on the RPC request again by using the Gray Processor before the RPC call of the compensation callback service is initiated, and the callback request can be matched to find a correct callback entrance. The embodiment of the invention does not need to add a service cluster to the version test point, reduces complex operations such as service management and the like, does not influence other nodes of the transaction due to the fact that the gray level version release of one node on the transaction calling link does not influence other nodes of the transaction, does not need to bring extra adaptive operation burden to other transaction nodes due to the fact that the service cluster of one node is added, supports flexible control of gray level flow in the transaction, and can enable the transaction application to more flexibly control gray level dyeing of flow on the link.
Based on the same inventive concept, the embodiment of the present invention further provides a distributed transaction variant-library mode inverse transaction calling device, as described in the following embodiment. Because the principles of solving the problems are similar to the distributed transaction heterogeneous library mode inverse transaction calling method, the implementation of the device can refer to the implementation of the method, and repeated details are not repeated.
Fig. 4 is a structural diagram of a distributed transaction heterogeneous library mode inverse transaction calling device in an embodiment of the present invention, as shown in fig. 4, the device includes:
an information generating module 401, configured to generate master transaction information at a master transaction side of a client;
a first information registration module 402, configured to register, by a client side, the master transaction information to a server side to obtain a master transaction ID;
a call request initiating module 403, configured to initiate an RPC call request on a client master transaction side after successful registration, where a gray level flow label is set in the RPC call request;
a provider searching module 404, configured to search, by the client master transaction side, a corresponding client terminal transaction side grayscale provider according to the grayscale flow label;
an information obtaining module 405, configured to obtain, by the client side, sub-transaction information and attribute information of the gray-scale flow label according to the RPC call request;
a second information registration module 406, configured to register, by the client side, the sub-transaction information to the server side according to the main transaction ID, so as to obtain a sub-transaction ID;
and the update request initiating module 407 is configured to, in the process of calling the sub-transaction service method, initiate an information update request to the server when the client side throws an exception, where the information update request is used to query all sub-transactions under the main transaction according to the main transaction ID after the server updates the main transaction information and the sub-transaction information, search a callback interface registered by the gray-scale provider according to the attribute information of the gray-scale flow label, and call a distributed transaction exception mode reverse transaction according to the callback interface.
In one embodiment, the provider lookup module 404 is further configured to:
matching the gray level flow labels with gray level marks preset by a plurality of providers;
and determining the gray level provider of the sub-transaction corresponding to the main transaction according to the matching result.
In one embodiment, the information update request is used for the server side to update the main transaction information and the sub-transaction information, and includes:
and the information updating request is used for updating the main transaction information into a compensation state and updating the sub-transaction information into a call failure state by the server.
In one embodiment, the update request initiation module 407 is further configured to:
when the client side transaction side throws an exception to the main transaction side, the main transaction side initiates an information updating request to the server side.
In summary, in the embodiments of the present invention, the master transaction information is generated by the master transaction side of the client; the client side registers the main transaction information to a server side to obtain a main transaction ID; after the registration is successful, a client side main transaction side initiates an RPC call request, wherein a gray level flow label is set in the RPC call request; the client main transaction side searches the corresponding client terminal transaction side gray level provider according to the gray level flow label; the client terminal transaction side acquires sub-transaction information and attribute information of the gray level flow label according to the RPC call request; the client side business side registers the sub-business information to the server side according to the main business ID to obtain a sub-business ID; in the process of calling the sub-transaction business method, when the client terminal transaction side throws an exception, an information updating request is initiated to the server side, the information updating request is used for the server side to update main transaction information and sub-transaction information, all sub-transactions under the main transaction are inquired according to the main transaction ID, a callback interface registered by a gray level provider is searched according to the attribute information of a gray level flow label, and the distributed transaction exception mode reverse transaction calling is carried out according to the callback interface. According to the embodiment of the invention, when the client terminal transaction side throws an exception, an information updating request is initiated to the server side, after the server side updates the main transaction information and the sub-transaction information, all sub-transactions under the main transaction are inquired according to the main transaction ID, and the callback interface registered by the gray level provider is searched according to the attribute information of the gray level flow label, so that complicated operations such as adding a service cluster for a version test point and reducing service management are not required, the operation complexity is effectively simplified, and the full link gray level is realized.
Based on the aforementioned inventive concept, as shown in fig. 5, the present invention further provides a computer device 500, which includes a memory 510, a processor 520, and a computer program 530 stored on the memory 510 and operable on the processor 520, wherein the processor 520 executes the computer program 530 to implement the aforementioned method for determining the amount of return of oil and gas drilling cuttings.
Based on the foregoing inventive concept, the present invention proposes a computer-readable storage medium storing a computer program which, when executed by a processor, implements the aforementioned method for determining an amount of return of oil and gas drilling cuttings.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A distributed transaction heterogeneous library mode inverse transaction calling method is characterized by comprising the following steps:
the client side generates main transaction information;
the client side registers the main transaction information to a server side to obtain a main transaction ID;
after the registration is successful, a client side main transaction side initiates an RPC call request, wherein a gray level flow label is set in the RPC call request;
the client main transaction side searches the corresponding client terminal transaction side gray level provider according to the gray level flow label;
the client terminal transaction side acquires sub-transaction information and attribute information of the gray level flow label according to the RPC call request;
the client side business side registers the sub-business information to the server side according to the main business ID to obtain a sub-business ID;
in the process of calling the sub-transaction business method, when the client terminal transaction side throws an exception, an information updating request is initiated to the server side, the information updating request is used for the server side to update main transaction information and sub-transaction information, all sub-transactions under the main transaction are inquired according to the main transaction ID, a callback interface registered by a gray level provider is searched according to the attribute information of a gray level flow label, and the distributed transaction exception mode reverse transaction calling is carried out according to the callback interface.
2. The distributed transaction library-based mode inverse transaction calling method of claim 1, wherein searching for a gray level provider of a sub-transaction corresponding to the main transaction according to the gray level flow label comprises:
matching the gray level flow labels with gray level marks preset by a plurality of providers;
and determining the gray level provider of the sub-transaction corresponding to the main transaction according to the matching result.
3. The distributed transaction library-based mode inverse transaction calling method of claim 1, wherein the information update request is used for a server side to update master transaction information and sub-transaction information, and comprises:
and the information updating request is used for updating the main transaction information into a compensation state and updating the sub-transaction information into a call failure state by the server.
4. The distributed transaction exception mode inverse transaction calling method of claim 1, wherein initiating an information update request to the server when the client side transaction side throws an exception comprises:
when the client side transaction side throws an exception to the main transaction side, the main transaction side initiates an information updating request to the server side.
5. A distributed transaction heterogeneous library mode inverse transaction calling device is characterized by comprising:
the information generation module is used for generating main transaction information by the main transaction side of the client;
the first information registration module is used for registering the main transaction information to a server side by a client side to obtain a main transaction ID;
the call request initiating module is used for initiating an RPC call request at a main transaction side of the client after the registration is successful, and a gray level flow label is set in the RPC call request;
the provider searching module is used for searching the corresponding client terminal transaction side gray level provider by the client main transaction side according to the gray level flow label;
the information acquisition module is used for the client terminal transaction side to acquire the sub-transaction information and the attribute information of the gray level flow label according to the RPC call request;
the second information registration module is used for the client side to register the sub-transaction information to the server side according to the main transaction ID to obtain the sub-transaction ID;
and the update request initiating module is used for initiating an information update request to the server when the client terminal transaction side throws an exception in the process of calling the sub-transaction service method, wherein the information update request is used for inquiring all sub-transactions under the main transaction according to the ID of the main transaction after the main transaction information and the sub-transaction information are updated by the server, searching a callback interface registered by a gray level provider according to the attribute information of the gray level flow label, and calling the distributed transaction exception-based mode reverse transaction according to the callback interface.
6. The distributed transaction variant library mode inverse transaction invoking device of claim 5, wherein the provider lookup module is further to:
matching the gray level flow labels with gray level marks preset by a plurality of providers;
and determining the gray level provider of the sub-transaction corresponding to the main transaction according to the matching result.
7. The distributed transaction variant library mode inverse transaction calling device of claim 5, wherein the information update request is used for a server side to update master transaction information and sub transaction information, and comprises:
and the information updating request is used for updating the main transaction information into a compensation state and updating the sub-transaction information into a call failure state by the server.
8. The distributed transaction library-style anti-trade calling device of claim 5, wherein the update request initiation module is further to:
when the client side transaction side throws an exception to the main transaction side, the main transaction side initiates an information updating request to the server side.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 4.
CN202110540794.0A 2021-05-18 2021-05-18 Distributed transaction different-library mode anti-transaction calling method and device Active CN113515352B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110540794.0A CN113515352B (en) 2021-05-18 2021-05-18 Distributed transaction different-library mode anti-transaction calling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110540794.0A CN113515352B (en) 2021-05-18 2021-05-18 Distributed transaction different-library mode anti-transaction calling method and device

Publications (2)

Publication Number Publication Date
CN113515352A true CN113515352A (en) 2021-10-19
CN113515352B CN113515352B (en) 2024-01-26

Family

ID=78064667

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110540794.0A Active CN113515352B (en) 2021-05-18 2021-05-18 Distributed transaction different-library mode anti-transaction calling method and device

Country Status (1)

Country Link
CN (1) CN113515352B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422398A (en) * 2021-12-28 2022-04-29 中国电信股份有限公司 Transaction node abnormity identification system, method and device
CN114422398B (en) * 2021-12-28 2024-05-14 中国电信股份有限公司 Transaction node abnormality recognition system, method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5613106A (en) * 1989-09-15 1997-03-18 Motorola, Inc. Method for processing and storing a transaction in a distributed database system
CN107045454A (en) * 2016-02-06 2017-08-15 华为技术有限公司 Striding course distributed transaction control method and related system
CN111666132A (en) * 2020-05-28 2020-09-15 中国平安财产保险股份有限公司 Distributed transaction implementation method, device, computer system and readable storage medium
CN112395104A (en) * 2020-11-16 2021-02-23 中国工商银行股份有限公司 Method and device for realizing transmission of distributed transaction context at routing layer

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5613106A (en) * 1989-09-15 1997-03-18 Motorola, Inc. Method for processing and storing a transaction in a distributed database system
CN107045454A (en) * 2016-02-06 2017-08-15 华为技术有限公司 Striding course distributed transaction control method and related system
CN111666132A (en) * 2020-05-28 2020-09-15 中国平安财产保险股份有限公司 Distributed transaction implementation method, device, computer system and readable storage medium
CN112395104A (en) * 2020-11-16 2021-02-23 中国工商银行股份有限公司 Method and device for realizing transmission of distributed transaction context at routing layer

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422398A (en) * 2021-12-28 2022-04-29 中国电信股份有限公司 Transaction node abnormity identification system, method and device
CN114422398B (en) * 2021-12-28 2024-05-14 中国电信股份有限公司 Transaction node abnormality recognition system, method and device

Also Published As

Publication number Publication date
CN113515352B (en) 2024-01-26

Similar Documents

Publication Publication Date Title
US7003776B2 (en) System and method for object persistence life-cycle and object caching integration
CN111522631B (en) Distributed transaction processing method, device, server and medium
CN102103642B (en) Data-erasure method based on OLTP, system and graphic data base server
KR20140047580A (en) Method and system for synchronization mechanism on multi-server reservation system
CN114615135B (en) Front-end gray level publishing method, system and storage medium
CN110231956B (en) Method, system and device for constructing application program version
US20220326940A1 (en) Service Upgrade Method, Apparatus, and System
CN111538519A (en) Version upgrading method and device
CN113691635A (en) Method and device for calling micro service, electronic equipment and readable storage medium
CN112100070A (en) Version defect detection method and device, server and storage medium
CN113836155A (en) Data processing method and device based on distributed system and storage medium
JP2001056767A (en) Method for cleaning up internal state by using transaction service synchronous interface
CN113515352B (en) Distributed transaction different-library mode anti-transaction calling method and device
GB2346990A (en) Client/server transaction processing system with automatic distributed co-ordinator set-up into a linear chain for use of linear commit optimisation
JP2006277158A (en) Data update system, server and program
CN115587114A (en) System and query method
CN114968498A (en) Distributed transaction processing method and device
CN114579406A (en) Method and device for realizing consistency of distributed transactions
CN114996246A (en) Data cleaning method for checking multiple fields of table based on NiFi assembly
CN115794927B (en) Service function expansion method and system
CN115809301B (en) Database processing method and device, electronic equipment and readable storage medium
CN115562880B (en) Micro-service-based treatment method and system
CN117172897A (en) Life cycle management method and device, electronic equipment and storage medium
CN116383893A (en) Block chain data statistics method and system
CN116701185A (en) Code debugging method of real-time task and electronic equipment

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