CN114816684A - Business processing method, device, equipment, readable storage medium and product - Google Patents

Business processing method, device, equipment, readable storage medium and product Download PDF

Info

Publication number
CN114816684A
CN114816684A CN202210486675.6A CN202210486675A CN114816684A CN 114816684 A CN114816684 A CN 114816684A CN 202210486675 A CN202210486675 A CN 202210486675A CN 114816684 A CN114816684 A CN 114816684A
Authority
CN
China
Prior art keywords
transaction
sub
main
unit
context
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.)
Pending
Application number
CN202210486675.6A
Other languages
Chinese (zh)
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 CN202210486675.6A priority Critical patent/CN114816684A/en
Publication of CN114816684A publication Critical patent/CN114816684A/en
Pending legal-status Critical Current

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
    • 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/465Distributed object oriented systems
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure provides a service processing method, device, equipment, readable storage medium and product, which are applied to the distributed field, and are applied to a main transaction unit in a distributed transaction platform, wherein the distributed transaction platform comprises the main transaction unit and at least one sub-transaction unit; the method comprises the following steps: acquiring a service processing request; storing the identification information and the state information of the main affair into an affair processor in a main affair unit according to the business processing request; generating a main transaction context according to the identification information and the state information; and sequentially sending the main transaction context to each sub-transaction unit according to the calling sequence so that the sub-transaction units perform information interaction with the main transaction unit according to the main transaction context. Therefore, when any sub-transaction unit fails, the main transaction unit can accurately perform task rollback operation on the sub-transaction unit. When any sub-transaction unit fails, other sub-transaction units can still operate normally, and the disaster tolerance is strong.

Description

Business processing method, device, equipment, readable storage medium and product
Technical Field
The present disclosure relates to the distributed field, and in particular, to a method, an apparatus, a device, a readable storage medium, and a product for processing a service.
Background
When the distributed transaction platform performs business processing, a main transaction often needs to call a plurality of sub applications. In the existing distributed transaction platform, the same transaction receiver and the same transaction server are generally used for the main transaction and the sub-transaction. When the business processing is carried out, the main affair and the sub affair can initiate the registration of the affair data corresponding to the persistence to the distributed affair platform.
However, when the distributed transaction platform adopting the above architecture performs service processing, and when the main transaction or the sub-transaction being processed is abnormal, the distributed transaction platform needs to notify all sub-transactions to execute inverse transactions to ensure the consistency of the transactions. The main affairs and the sub affairs all depend on the same set of the same affair receiver and the affair server, so that the efficiency of the distributed affair platform for processing the business is low, when any affair breaks down, the whole business cannot be processed continuously, and the disaster tolerance is low.
Disclosure of Invention
The present disclosure provides a service processing method, device, equipment, readable storage medium and product, which are used to solve the technical problems of low efficiency and low disaster tolerance of the service processing of the existing distributed transaction platform.
The first aspect of the present disclosure is to provide a service processing method, which is applied to a main transaction unit in a distributed transaction platform, where the distributed transaction platform includes the main transaction unit and at least one sub-transaction unit; the method comprises the following steps:
acquiring a service processing request, wherein the service processing request comprises identification information and a calling sequence of at least one sub-transaction called by a main transaction;
storing the identification information and the state information of the main transaction into a transaction processor preset in the main transaction unit according to the service processing request;
generating a main transaction context according to the identification information and the state information;
and sequentially sending the main transaction context to each sub-transaction unit according to the calling sequence so as to enable the sub-transaction units to perform sub-transaction processing according to the main transaction context, and perform information interaction with the main transaction unit according to the main transaction context.
A second aspect of the present disclosure is to provide a service processing method, which is applied to any one sub-transaction unit in a distributed transaction platform, where the distributed transaction platform includes a main transaction unit and at least one sub-transaction unit; the method comprises the following steps:
acquiring a main transaction context sent by a main transaction unit, wherein the main transaction context comprises identification information and state information of a main transaction;
and performing sub-transaction processing according to the context, and performing information interaction with the main transaction unit according to the main transaction context.
A third aspect of the present disclosure is to provide a master transaction processing apparatus, which is applied to a distributed transaction platform, where the distributed transaction platform includes a master transaction unit and at least one sub-transaction unit; the device comprises:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a service processing request which comprises identification information and a calling sequence of at least one sub-transaction called by a main transaction;
the storage module is used for storing the identification information and the state information of the main transaction into a transaction processor preset in the main transaction unit according to the service processing request;
the generating module is used for generating a main transaction context according to the identification information and the state information;
and the sending module is used for sequentially sending the main transaction context to each sub-transaction unit according to the calling sequence so as to enable the sub-transaction units to perform sub-transaction processing according to the main transaction context and perform information interaction with the main transaction unit according to the main transaction context.
A fourth aspect of the present disclosure is to provide a sub-transaction processing apparatus, which is applied to any one sub-transaction unit in a distributed transaction platform, where the distributed transaction platform includes a main transaction unit and at least one sub-transaction unit; the device comprises:
the context acquisition module is used for acquiring a main transaction context sent by a main transaction unit, wherein the main transaction context comprises identification information and state information of a main transaction;
and the processing module is used for performing sub-transaction processing according to the context and performing information interaction with the main transaction unit according to the main transaction context.
A fifth aspect of the present disclosure is to provide an electronic apparatus, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to call program instructions in the memory to execute the business processing method according to the first aspect or the second aspect.
A sixth aspect of the present disclosure is to provide a computer-readable storage medium, having stored therein computer-executable instructions, which when executed by a processor, are used for implementing the business processing method according to the first or second aspect.
A seventh aspect of the present disclosure is to provide a computer program product comprising a computer program which, when executed by a processor, implements the business processing method of the first or second aspect.
The service processing method, the device, the equipment, the readable storage medium and the product provided by the disclosure are used for obtaining the distributed transaction platform comprising the main transaction unit and at least one sub-transaction unit by performing unitized transformation on the distributed transaction platform. And storing the relevant information of the main transaction into a transaction processor of the main transaction unit according to the service processing request, and performing information interaction with each sub-transaction unit through the main transaction context, so that each sub-unit can perform information interaction with the main transaction unit according to the main transaction context. And then the main transaction unit can accurately perform task rollback operation on the sub-transaction units when any sub-transaction unit fails. In addition, by performing unitized transformation on the distributed transaction platform, when any sub-transaction unit fails, other sub-transaction units can still normally operate, and the disaster tolerance is strong.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a system architecture diagram of a conventional distributed transaction platform;
fig. 2 is a schematic structural diagram of a distributed transaction platform provided in an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a service processing method according to an embodiment of the present disclosure;
fig. 4 is a schematic flow chart of a service processing method according to a second embodiment of the present disclosure;
fig. 5 is a schematic flow chart of a service processing method provided in the third embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a master transaction processing apparatus according to a fourth embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a sub-transaction processing apparatus according to a fifth embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments obtained based on the embodiments in the disclosure belong to the protection scope of the disclosure.
In view of the above-mentioned technical problems of low efficiency and low disaster tolerance of the conventional distributed transaction platform service processing, the present disclosure provides a service processing method, apparatus, device, readable storage medium, and product.
The present disclosure provides a business processing method, apparatus, device, readable storage medium and product, which can be applied in various scenarios of distributed transaction platform transaction processing.
It should be noted that the service processing method, device, apparatus, readable storage medium and product provided by the present disclosure may be used in the distributed field. But also in any field other than the distributed field. The service processing method, device, equipment, readable storage medium and product provided by the disclosure are not limited to the application field.
Fig. 1 is a schematic system architecture diagram of a conventional distributed transaction platform, as shown in fig. 1, the conventional distributed transaction platform includes a main transaction 11, a sub-transaction 12, and a sub-transaction 13, wherein the main transaction 11 sequentially schedules the driver transaction 12 and the sub-transaction 13. The main transaction 11 and the sub-transactions 12 and 13 are communicatively connected to a transaction receiver 14, respectively, so as to be able to exchange information with the transaction receiver 14. The transaction receiver 14 is connected to the transaction server 15 for data storage. The sub-transactions also register sub-transaction information with the transaction platform and associate with corresponding main transaction 11 information before performing the actual business transaction. When the transaction is abnormal, the transaction processor 15 informs all the sub-transactions to execute the anti-transaction to ensure the consistency of the whole transaction. The main transaction 11 and the sub-transactions both depend on the same set of the same transaction receiver 14 and the same transaction server 15, so that the efficiency of the distributed transaction platform for processing the services is low, when any transaction fails, the whole service cannot be processed continuously, and the disaster tolerance is low.
In the process of solving the technical problem, the inventor finds out through research that the distributed transaction platform can be transformed into a unit. After the retrofit, there is only one master transaction unit, and the inventory service continues to provide support within the master transaction unit. The system comprises a plurality of sub-transaction units, wherein each sub-transaction unit is provided with a whole set of transaction platform services, and the transaction can be ensured to be closed in one unit. Therefore, even if any transaction unit fails, other transaction units can still operate normally.
Fig. 2 is a schematic structural diagram of a distributed transaction platform according to an embodiment of the present disclosure, as shown in fig. 2, the distributed transaction platform includes a main transaction unit 21 and a sub-transaction unit 22, and each transaction unit includes a transaction receiver 23 and a transaction processor 24. Each sub-transaction unit has a whole set of transaction platform services, and the transaction can be ensured to be closed-loop in one unit.
Fig. 3 is a schematic flowchart of a service processing method provided in an embodiment of the present disclosure, which is applied to a main transaction unit in a distributed transaction platform, where the distributed transaction platform includes the main transaction unit and at least one sub-transaction unit; as shown in fig. 3, the method includes:
step 301, a service processing request is obtained, where the service processing request includes identification information and a calling sequence of at least one sub-transaction called by a main transaction.
The execution subject of this embodiment is the main transaction processing device, and the service processing device can be coupled to the main transaction unit. The main transaction unit and each sub-transaction unit comprise a separate transaction receiver and a transaction processor. The transaction receiver is used for information interaction with other transaction units, and the transaction processor is used for data storage.
In this embodiment, the master transaction unit may obtain a service processing request, where the service processing request includes identification information and a calling sequence of at least one sub-transaction called by the master transaction. Therefore, the main transaction unit can sequentially adjust the starting transaction to perform the transaction processing according to the identification information and the calling sequence in the service processing request.
Optionally, the main transaction unit may perform a starting operation on each sub-transaction unit, and after each sub-transaction unit completes the transaction processing, end the flow of the main transaction to ensure the completeness of the processed service.
Step 302, storing the identification information and the state information of the master transaction into a preset transaction processor in the master transaction unit according to the service processing request.
In this embodiment, after the service processing request is obtained, the identification information and the state information of the master transaction may be stored in a transaction processor preset in the master transaction unit according to the service processing request. The transaction processor may store a main transaction table and a sub-transaction table, where the main transaction table is used to store unit information such as identification information and state information of a main transaction unit. The sub-transaction table is used for storing unit information such as identification information of each sub-transaction unit.
Therefore, after acquiring the service processing request, the master transaction unit may initiate a request to the transaction receiver and record unit information such as identification information, status information, etc. into the master transaction table.
And 303, generating a main transaction context according to the identification information and the state information.
In this embodiment, in order to implement information interaction with the sub-transaction, information that enables the sub-transaction unit to determine the main transaction unit that needs to perform data interaction is also required. Thus, a master transaction context may be generated based on the identification information as well as the state information.
The main transaction unit and the sub transaction unit can exchange information through the transaction context. Optionally, the master transaction unit may send the master transaction context to the child transaction units. The sub-transaction unit may send the sub-transaction context to the master transaction unit.
And step 304, sequentially sending the main transaction context to each sub-transaction unit according to the calling sequence so that the sub-transaction units perform sub-transaction processing according to the main transaction context, and perform information interaction with the main transaction unit according to the main transaction context.
In this embodiment, the number of the sub-units that the main transaction unit needs to call is at least one, and there may be different calling orders between different sub-transactions. Thus, the master transaction unit may send the master transaction context to each of the child transaction units in turn according to the call order. Correspondingly, after the sub-transaction unit obtains the main transaction context, the sub-transaction unit can perform sub-transaction processing according to the main transaction context, and perform information interaction with the main transaction unit according to the main transaction context.
The service processing method provided in this embodiment obtains a distributed transaction platform including a main transaction unit and at least one sub-transaction unit by performing unitized transformation on the distributed transaction platform. And storing the relevant information of the main transaction into a transaction processor of the main transaction unit according to the service processing request, and performing information interaction with each sub-transaction unit through the main transaction context, so that each sub-unit can perform information interaction with the main transaction unit according to the main transaction context. And when any sub-transaction unit fails, the main transaction unit can accurately perform task rollback operation on the sub-transaction unit. In addition, by performing unitized transformation on the distributed transaction platform, when any sub-transaction unit fails, other sub-transaction units can still normally operate, and the disaster tolerance is strong.
Further, on the basis of the first embodiment, after the step 304, the method further includes:
and if detecting that the last sub-transaction unit in the calling sequence completes the sub-transaction processing operation, ending the main transaction flow.
In this embodiment, the main transaction unit can perform a starting operation on each sub-transaction unit, and after each sub-transaction unit completes the transaction processing, the flow of the main transaction is ended to ensure the completeness of the processed service. Specifically, whether the last sub-transaction unit in the calling order completes the sub-transaction processing operation can be detected according to the calling order. If so, the main transaction flow may end.
After each sub-transaction unit finishes transaction processing, the main transaction flow is ended, so that the integrity of the currently processed service can be ensured.
Fig. 4 is a schematic flow chart of a service processing method provided in a second embodiment of the present disclosure, and on the basis of any one of the above embodiments, as shown in fig. 4, the method further includes:
step 401, obtaining a sub-transaction context sent by each sub-transaction unit, where the sub-transaction context includes identification information of the sub-transaction unit.
Step 402, storing the sub-transaction context sent by each sub-transaction unit into a preset transaction processor in the main transaction unit.
In this embodiment, in the distributed transaction platform, a transaction may involve multiple transaction units, and in the unitization transformation process, not all transaction units may have completed unitization transformation, and only some transaction units may have completed transformation, which needs to ensure smooth upgrade of the application side. Meanwhile, in the transformation process, the main sub-transaction may be in different units, and how to synchronize the information and the state of the main sub-transaction is also a problem to be solved. For example, assume that the main transaction and sub-transaction 1 have completed the unitization transformation and sub-transaction 2 has not completed. At this time, when the transaction rolls back, how to find the sub-transaction of the corresponding unit to initiate the anti-transaction is some problems to be solved.
Therefore, in order to ensure smooth upgrading of the distributed transaction platform unitization transformation, the unit information of the main transaction and the unit information of the sub-transaction can be stored into the transaction processing in the main transaction unit in a persistent manner. The transaction processor may store a main transaction table and a sub-transaction table, where the main transaction table is used to store unit information such as identification information and state information of a main transaction unit. The sub-transaction table is used for storing unit information such as identification information of each sub-transaction unit.
After acquiring the main transaction context sent by the main transaction unit, the sub-transaction unit may generate the sub-transaction context according to its unit information, for example, content such as identification information of the sub-transaction unit. And feeding back the sub-transaction context to the main transaction unit according to the main transaction identifier in the main transaction context. Accordingly, the main transaction unit may obtain the sub-transaction context sent by each sub-transaction unit, where the sub-transaction context includes the identification information of the sub-transaction unit. And storing the sub-transaction context sent by each sub-transaction unit into a preset transaction processor in the main transaction unit. Optionally, the sub-transaction context may be stored in a sub-transaction table of a transaction processor preset in the main transaction unit.
In the service processing method provided by this embodiment, the unit information of the main transaction unit and the sub-transaction unit is transmitted in a message context manner and is stored in the transaction processor preset in the main transaction unit, so that when a transaction rollback needs to be performed, processing can be accurately performed according to the content stored in the transaction processor, and the disaster tolerance of the distributed transaction platform is improved.
Further, on the basis of any of the above embodiments, after the step 402, the method further includes:
and if the transaction processing of any sub-transaction unit is detected to fail, performing transaction rollback operation on the transaction processed by the sub-transaction unit according to the context of the sub-transaction unit stored in the transaction processor in the main transaction unit.
In this embodiment, whether the transaction processing of the sub-transaction unit is successful can be detected in real time. A rollback operation is required when its processing fails. The unit information of the main transaction unit and the sub-transaction unit is transmitted in a message context mode and stored in a preset transaction processor in the main transaction unit, and when the failure of the transaction processing of any sub-transaction unit is detected, the transaction rollback operation is performed on the transaction processed by the sub-transaction unit according to the context of the sub-transaction unit stored in the transaction processor in the main transaction unit.
In the service processing method provided by this embodiment, the unit information of the main transaction unit and the sub-transaction units is persistently stored in the transaction processor in the main transaction unit, so that when a problem occurs in the transaction processing of any sub-transaction unit, the sub-transaction unit can be accurately located, the rollback operation is realized, the efficiency of the transaction processing is improved, and the disaster tolerance of the distributed transaction platform is improved.
Fig. 5 is a schematic flow chart of a service processing method provided in a third embodiment of the present disclosure, which is applied to any one sub-transaction unit in a distributed transaction platform, where the distributed transaction platform includes a main transaction unit and at least one sub-transaction unit; the method comprises the following steps:
step 501, acquiring a main transaction context sent by a main transaction unit, wherein the main transaction context comprises identification information and state information of a main transaction;
step 502, performing sub-transaction processing according to the context, and performing information interaction with the main transaction unit according to the main transaction context.
The execution subject of this embodiment is a sub-transaction processing device, which may be coupled to the sub-transaction unit.
In this embodiment, the main transaction unit may generate a main transaction context according to the identification information and the state information, and sequentially send the main transaction context to each sub-transaction unit according to the calling order. Correspondingly, after the sub-transaction unit obtains the main transaction context, the sub-transaction unit can perform sub-transaction processing according to the main transaction context, and perform information interaction with the main transaction unit according to the main transaction context.
The service processing method provided in this embodiment obtains a distributed transaction platform including a main transaction unit and at least one sub-transaction unit by performing unitized transformation on the distributed transaction platform. And storing the relevant information of the main transaction into a transaction processor of the main transaction unit according to the service processing request, and performing information interaction with each sub-transaction unit through the main transaction context, so that each sub-unit can perform information interaction with the main transaction unit according to the main transaction context. When any sub-transaction unit fails, other sub-transaction units can still normally operate, and the disaster tolerance is strong.
Further, on the basis of the third embodiment, the step 501 includes:
and generating a sub-transaction context according to the main transaction context based on the identification information and the unit information of the sub-transaction.
And sending the sub-transaction context to a transaction processor in the main transaction unit for storage.
In this embodiment, after acquiring the main transaction context, the sub-transaction unit may generate the sub-transaction context according to its unit information, for example, content such as identification information of the sub-transaction unit, after acquiring the main transaction context sent by the main transaction unit. And feeding back the sub-transaction context to the main transaction unit according to the main transaction identifier in the main transaction context. Accordingly, the main transaction unit may obtain the sub-transaction context sent by each sub-transaction unit, where the sub-transaction context includes the identification information of the sub-transaction unit. And storing the sub-transaction context sent by each sub-transaction unit into a preset transaction processor in the main transaction unit.
In the service processing method provided by this embodiment, the unit information of the sub-transaction units is persistently stored in the transaction processor in the main transaction unit, so that when a problem occurs in the transaction processing of any sub-transaction unit, the sub-transaction unit can be accurately located, the rollback operation is implemented, the efficiency of the transaction processing is improved, and the disaster tolerance of the distributed transaction platform is improved.
Further, on the basis of the third embodiment, before sending the sub-transaction context to the transaction processor in the main transaction unit for storage, the method further includes:
and determining whether the current running state of the master transaction unit is normal or not through the master transaction context.
And when the main transaction unit is in a normal running state, sending the sub-transaction context to a transaction processor in the main transaction unit for storage.
In this embodiment, in order to register the unit information of the sub-transaction unit, it is necessary to ensure that the main transaction is currently in a normal operation state. For example, if the current master transaction unit is in a rollback state, the storage of the sub-transaction unit context information cannot be achieved. Therefore, before sending the context information, the sub-transaction unit may determine in advance whether the current running state of the main transaction unit is normal or not through the main transaction context. And when the main transaction unit is in a normal running state, sending the sub-transaction context to a transaction processor in the main transaction unit for storage.
The service processing method provided by this embodiment determines the current state of the main transaction unit before sending the context information, thereby implementing information interaction between the main transaction unit and the sub-transaction unit, and ensuring the accuracy of transaction processing.
Fig. 6 is a schematic structural diagram of a master transaction processing apparatus according to a fourth embodiment of the present disclosure, which is applied to a distributed transaction platform, where the distributed transaction platform includes a master transaction unit and at least one sub-transaction unit. As shown in fig. 6, the apparatus includes: an acquisition module 61, a storage module 62, a generation module 63 and a transmission module 64. The obtaining module 61 is configured to obtain a service processing request, where the service processing request includes identification information of at least one sub-transaction called by a main transaction and a calling sequence. And a storage module 62, configured to store the identification information and the state information of the master transaction into a transaction processor preset in the master transaction unit according to the service processing request. And a generating module 63, configured to generate a main transaction context according to the identification information and the state information. A sending module 64, configured to send the main transaction context to each sub-transaction unit in sequence according to the calling order, so that the sub-transaction unit performs sub-transaction processing according to the main transaction context, and performs information interaction with the main transaction unit according to the main transaction context.
Further, on the basis of the fourth embodiment, the method further includes: the obtaining module is further configured to obtain a sub-transaction context sent by each sub-transaction unit, where the sub-transaction context includes identification information of the sub-transaction unit. And the storage module is further used for storing the sub-transaction context sent by each sub-transaction unit into a preset transaction processor in the main transaction unit.
Further, on the basis of any one of the above embodiments, the apparatus further includes: and the rollback module is used for performing transaction rollback operation on the transactions processed by the sub-transaction units according to the contexts of the sub-transaction units, which are stored in the transaction processor in the main transaction unit, if the failure of the transaction processing of any sub-transaction unit is detected.
Further, on the basis of any one of the above embodiments, the apparatus further includes: and the termination module is used for terminating the main transaction flow if the last sub-transaction unit in the calling sequence is detected to finish the sub-transaction processing operation.
Fig. 7 is a schematic structural diagram of a sub-transaction processing apparatus provided in a fifth embodiment of the present disclosure, which is applied to any one sub-transaction unit in a distributed transaction platform, where the distributed transaction platform includes a main transaction unit and at least one sub-transaction unit. As shown in fig. 7, the apparatus includes: a context acquisition module 71 and a processing module 72. The context obtaining module 71 is configured to obtain a master transaction context sent by a master transaction unit, where the master transaction context includes identification information and state information of the master transaction. And the processing module 72 is configured to perform sub-transaction processing according to the context, and perform information interaction with the main transaction unit according to the main transaction context.
Further, on the basis of any of the above embodiments, the processing module is configured to: and generating a sub-transaction context according to the main transaction context based on the identification information and the unit information of the sub-transaction. And sending the sub-transaction context to a transaction processor in the main transaction unit for storage.
Further, on the basis of any one of the above embodiments, the apparatus further includes: and the determining module is used for determining whether the current running state of the master transaction unit is normal or not through the master transaction context. And the sending module is used for sending the sub-transaction context to a transaction processor in the main transaction unit for storage when the main transaction unit is in a normal running state.
In order to implement the above embodiments, an embodiment of the present disclosure further provides an electronic device, including: a processor and a memory;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored in the memory, so that the processor executes the service request processing method according to any one of the embodiments.
Fig. 8 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present disclosure, and as shown in fig. 8, the electronic device 800 may be a terminal device or a server. Among them, the terminal Device may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a Digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a Portable Multimedia Player (PMP), a car terminal (e.g., car navigation terminal), etc., and a fixed terminal such as a Digital TV, a desktop computer, etc. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 8, an electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 801 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage device 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 800 are also stored. The processing apparatus 801, the ROM802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 807 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 8 illustrates an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
Yet another embodiment of the present disclosure further provides a computer-readable storage medium, where a computer executing instruction is stored in the computer-readable storage medium, and when a processor executes the computer executing instruction, the service request processing method according to any of the above embodiments is implemented.
Yet another embodiment of the present disclosure further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for processing a service request according to any of the above embodiments is implemented.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present disclosure, and not for limiting the same; while the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present disclosure.

Claims (12)

1. A business processing method is characterized in that the business processing method is applied to a main business unit in a distributed business platform, and the distributed business platform comprises the main business unit and at least one sub business unit; the method comprises the following steps:
acquiring a service processing request, wherein the service processing request comprises identification information and a calling sequence of at least one sub-transaction called by a main transaction;
storing the identification information and the state information of the main transaction into a transaction processor preset in the main transaction unit according to the service processing request;
generating a main transaction context according to the identification information and the state information;
and sequentially sending the main transaction context to each sub-transaction unit according to the calling sequence so as to enable the sub-transaction units to perform sub-transaction processing according to the main transaction context, and perform information interaction with the main transaction unit according to the main transaction context.
2. The method of claim 1, further comprising:
acquiring a sub-transaction context sent by each sub-transaction unit, wherein the sub-transaction context comprises identification information of the sub-transaction unit;
and storing the sub-transaction context sent by each sub-transaction unit into a preset transaction processor in the main transaction unit.
3. The method according to claim 2, wherein after storing the sub-transaction context sent by each sub-transaction unit in a preset transaction processor in the main transaction unit, the method further comprises:
and if the transaction processing of any sub-transaction unit is detected to fail, performing transaction rollback operation on the transaction processed by the sub-transaction unit according to the context of the sub-transaction unit stored in the transaction processor in the main transaction unit.
4. The method of claim 1, wherein after sending the main transaction context to each sub-transaction unit in sequence according to the calling order, further comprising:
and if detecting that the last sub-transaction unit in the calling sequence completes the sub-transaction processing operation, ending the main transaction flow.
5. A business processing method is characterized in that the business processing method is applied to any one sub-transaction unit in a distributed transaction platform, and the distributed transaction platform comprises a main transaction unit and at least one sub-transaction unit; the method comprises the following steps:
acquiring a main transaction context sent by a main transaction unit, wherein the main transaction context comprises identification information and state information of a main transaction;
and performing sub-transaction processing according to the context, and performing information interaction with the main transaction unit according to the main transaction context.
6. The method of claim 5, wherein said interacting information with the master transaction unit according to the master transaction context comprises:
generating a sub-transaction context according to the main transaction context based on the identification information and the unit information of the sub-transaction;
and sending the sub-transaction context to a transaction processor in the main transaction unit for storage.
7. The method of claim 6, wherein before sending the sub-transaction context to a transaction processor in the master transaction unit for storage, further comprising:
determining whether the current running state of the master transaction unit is normal or not according to the master transaction context;
and when the main transaction unit is in a normal running state, sending the sub-transaction context to a transaction processor in the main transaction unit for storage.
8. The main transaction processing device is applied to a distributed transaction platform, wherein the distributed transaction platform comprises a main transaction unit and at least one sub-transaction unit; the device comprises:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a service processing request which comprises identification information and a calling sequence of at least one sub-transaction called by a main transaction;
the storage module is used for storing the identification information and the state information of the main transaction into a transaction processor preset in the main transaction unit according to the service processing request;
the generating module is used for generating a main transaction context according to the identification information and the state information;
and the sending module is used for sequentially sending the main transaction context to each sub-transaction unit according to the calling sequence so as to enable the sub-transaction units to perform sub-transaction processing according to the main transaction context and perform information interaction with the main transaction unit according to the main transaction context.
9. The sub-transaction processing device is applied to any one sub-transaction unit in a distributed transaction platform, wherein the distributed transaction platform comprises a main transaction unit and at least one sub-transaction unit; the device comprises:
the context acquisition module is used for acquiring a main transaction context sent by a main transaction unit, wherein the main transaction context comprises identification information and state information of a main transaction;
and the processing module is used for performing sub-transaction processing according to the context and performing information interaction with the main transaction unit according to the main transaction context.
10. An electronic device, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to invoke program instructions in the memory to perform the business process method of any of claims 1-4 or 5-7.
11. A computer-readable storage medium having stored thereon computer-executable instructions for implementing the business process method of any one of claims 1-4 or 5-7 when executed by a processor.
12. A computer program product, characterized in that it comprises a computer program which, when executed by a processor, implements a business process method according to any one of claims 1-4 or 5-7.
CN202210486675.6A 2022-05-06 2022-05-06 Business processing method, device, equipment, readable storage medium and product Pending CN114816684A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210486675.6A CN114816684A (en) 2022-05-06 2022-05-06 Business processing method, device, equipment, readable storage medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210486675.6A CN114816684A (en) 2022-05-06 2022-05-06 Business processing method, device, equipment, readable storage medium and product

Publications (1)

Publication Number Publication Date
CN114816684A true CN114816684A (en) 2022-07-29

Family

ID=82511157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210486675.6A Pending CN114816684A (en) 2022-05-06 2022-05-06 Business processing method, device, equipment, readable storage medium and product

Country Status (1)

Country Link
CN (1) CN114816684A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117632140A (en) * 2023-12-07 2024-03-01 易方达基金管理有限公司 Business process processing method, device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117632140A (en) * 2023-12-07 2024-03-01 易方达基金管理有限公司 Business process processing method, device and storage medium

Similar Documents

Publication Publication Date Title
EP4033374A1 (en) Method and device for synchronizing node data
CN105787077B (en) Data synchronization method and device
CN109753332B (en) Method and device for displaying information
CN111309747A (en) Data synchronization method, system and device
CN115268854A (en) Service expansion implementation method, system, electronic equipment and readable storage medium
CN110727523B (en) Service request processing method, service request processing device and readable storage medium
CN114816684A (en) Business processing method, device, equipment, readable storage medium and product
CN111338834A (en) Data storage method and device
CN111966508A (en) Message batch sending method and device, computer equipment and storage medium
CN116302271A (en) Page display method and device and electronic equipment
CN115623082A (en) Financial service calling method, system, electronic equipment and storage medium
CN113835790B (en) Paging page display method and device based on Android
CN110427135B (en) Method, device, terminal and storage medium for determining application call
CN110851097B (en) Control method, device, medium and electronic equipment for consistency of handwriting data
CN112818336A (en) Data access method, data access device and computer readable storage medium
CN113781154A (en) Information rollback method, system, electronic equipment and storage medium
CN112311842A (en) Method and device for information interaction
CN107209882B (en) Multi-stage de-registration for managed devices
CN116010126B (en) Service aggregation method, device and system
CN111258852B (en) Abnormal data monitoring method, device, electronic equipment and storage medium
US20240152504A1 (en) Data interaction method, apparatus, and electronic device
CN112769824B (en) Information transmission state updating method, terminal, device and storage medium
CN110099122B (en) Method and apparatus for sending network request
CN116204291A (en) Task processing method, device, computer equipment and storage medium
CN117539661A (en) Micro-service architecture industry expansion development method, system, equipment and storage medium

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