CN115499493A - Asynchronous transaction processing method and device, storage medium and computer equipment - Google Patents

Asynchronous transaction processing method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN115499493A
CN115499493A CN202211114478.8A CN202211114478A CN115499493A CN 115499493 A CN115499493 A CN 115499493A CN 202211114478 A CN202211114478 A CN 202211114478A CN 115499493 A CN115499493 A CN 115499493A
Authority
CN
China
Prior art keywords
asynchronous
asynchronous method
annotation
database
execution
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
CN202211114478.8A
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.)
Pingan Payment Technology Service Co Ltd
Original Assignee
Pingan Payment Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Pingan Payment Technology Service Co Ltd filed Critical Pingan Payment Technology Service Co Ltd
Priority to CN202211114478.8A priority Critical patent/CN115499493A/en
Publication of CN115499493A publication Critical patent/CN115499493A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/288Distributed intermediate devices, i.e. intermediate devices for interaction with other intermediate devices on the same level

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an asynchronous transaction processing method, an asynchronous transaction processing device, a storage medium and computer equipment, which are applied to a microservice application system and relate to the technical field of computer information processing. The method comprises the following steps: monitoring the execution condition of an asynchronous method for processing asynchronous transactions in a microservice application system, wherein the asynchronous method has preset annotation information which comprises execution annotation; judging whether the asynchronous method is successfully executed or not, and judging whether the annotation information of the asynchronous method is execution annotation or not; if the asynchronous method fails to be executed and the annotation information of the asynchronous method is the execution annotation, the asynchronous method is stored in a database; asynchronous methods are scheduled and executed from the database. The method can ensure that the asynchronous transaction can be successfully executed, and simultaneously, the occupied resources of the engineering system are effectively reduced when the asynchronous transaction is solved.

Description

Asynchronous transaction processing method and device, storage medium and computer equipment
Technical Field
The present invention relates to the field of computer information processing, and in particular, to an asynchronous transaction processing method, apparatus, storage medium, and computer device.
Background
The transaction is an important component in an engineering system and is an important guarantee for maintaining data atomicity operation. When a request for creating a resource comes, in order to ensure the data atomicity of the request, the engineering system must ensure that all data operations must be executed successfully or failed.
Under normal conditions, the engineering system only needs to place the operation of the database in a spring transaction to achieve the atomicity of the operation. However, because of the relatively complex and time-consuming business processes in an engineering system, which require asynchronous threads to process or operate across databases, and even require cross-system processing logic, these businesses are asynchronous transactions. In the face of this situation, these asynchronous transactions cannot be handled if a single spring transaction is used. The current spring transaction can resolve the atomic transaction operation executed by the current thread based on the current unique database. Any asynchronous transaction across threads, databases and applications cannot be processed by the traditional transaction processing mode.
To solve the above problem, the conventional processing strategy is to add message-oriented middleware (message-oriented middleware) between multiple systems. The message middleware generally has a producer confirmation function, a message confirmation function and a dead message queue, and ensures that the asynchronous transaction can reach final consistency to the maximum extent. But adding such message middleware would make the system too bulky. When the engineering system encounters logic needing asynchronous thread processing only due to time consumption, a huge middleware component is added, which is unreasonable, and the problem of high resource occupation when the engineering system processes asynchronous transactions can be caused.
Disclosure of Invention
In view of this, the present application provides an asynchronous transaction processing method, an asynchronous transaction processing apparatus, a storage medium, and a computer device, and mainly aims to solve the problem that an engineering system occupies too much resources when processing an asynchronous transaction.
According to a first aspect of the present invention, there is provided an asynchronous transaction processing method applied to a microservice application system, the method comprising:
monitoring the execution condition of an asynchronous method for processing asynchronous transactions in the microservice application system, wherein the asynchronous method has preset annotation information which comprises execution annotation;
judging whether the asynchronous method is successfully executed or not, and judging whether annotation information of the asynchronous method is execution annotation or not;
if the asynchronous method fails to be executed and the annotation information of the asynchronous method is an execution annotation, storing the asynchronous method in a database;
scheduling and executing the asynchronous method from the database.
According to a second aspect of the present invention, there is provided an asynchronous transaction processing apparatus, comprising:
the data monitoring module is used for monitoring the execution condition of an asynchronous method for processing asynchronous transactions in the microservice application system, wherein the asynchronous method has preset annotation information, and the annotation information comprises execution annotation;
the data judgment module is used for judging whether the asynchronous method is successfully executed and judging whether the annotation information of the asynchronous method is execution annotation;
the data calling module is used for storing the asynchronous method into a database if the asynchronous method fails to be executed and the annotation information of the asynchronous method is an execution annotation;
and the data execution module is used for scheduling and executing the asynchronous method from the database.
According to a third aspect of the present invention, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described asynchronous transaction processing method.
According to a fourth aspect of the present invention, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the above asynchronous transaction processing method when executing the program.
The invention provides an asynchronous transaction processing method, an asynchronous transaction processing device, a storage medium and computer equipment. According to the technical scheme, annotation information is added into the asynchronous method, the asynchronous method is stored and called based on the delay queue in the database, and the asynchronous transaction is processed, so that the technical scheme is neat and clear in framework and simple in setting, the asynchronous transaction can be successfully executed under the condition that a message middleware is not required to be set, and occupied resources of an engineering system are effectively reduced when the asynchronous transaction is solved. Meanwhile, the technical scheme of the application can adapt to most system scenes, and has strong expansibility.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of asynchronous transactions of the same system provided by an embodiment of the invention;
FIG. 2 is a schematic diagram of asynchronous transactions across databases of the same system provided by an embodiment of the invention;
FIG. 3 is a schematic diagram illustrating an asynchronous transaction across systems provided by an embodiment of the invention;
FIG. 4 is a flow chart illustrating an asynchronous transaction processing method provided by an embodiment of the invention;
FIG. 5 is a block diagram of an asynchronous transaction processing device according to an embodiment of the present invention;
fig. 6 is a second flowchart of an asynchronous transaction processing apparatus according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
In an engineering system, when a request for creating a resource comes, in order to ensure the data atomicity of the request, the engineering system must ensure that all data operations must be executed successfully or failed. Under normal conditions, the engineering system only needs to place the operation of the database in a spring transaction to achieve the atomicity of the operation. However, because of the relatively complex and time-consuming business processes in an engineering system, which require asynchronous threads to process or operate across databases, and even require cross-system processing logic, these businesses are asynchronous transactions. The asynchronous transactions include asynchronous transactions with the system, asynchronous transactions across databases with the system, and asynchronous transactions across systems.
As shown in FIG. 1, asynchronous transactions in the same system are executed by a main thread in the system and by an asynchronous thread, which use the same database. For asynchronous transactions across databases in the same system, as shown in fig. 2, the asynchronous transactions across databases in the same system are mainly used for implementing transactions executed based on different databases. Fig. 3 is a schematic diagram of an asynchronous transaction across systems, and as shown in fig. 3, a call interface needs to be established between main threads of two systems to implement asynchronous transaction execution between the systems. In the face of these situations, these asynchronous transactions cannot be handled if only one spring transaction is used. The current spring transaction can resolve the atomic transaction operation executed by the current thread based on the current unique database. Any asynchronous transaction across threads, databases and applications cannot be processed by the traditional transaction processing mode. In response to the above problem, the conventional processing strategy is to add message-oriented middleware (message-oriented middleware) between multiple systems. The message middleware generally has a producer confirmation function, a message confirmation function and a deadlock queue, and ensures that the asynchronous transaction can reach final consistency to the maximum extent. But adding such message middleware would make the system too bulky. When the engineering system encounters logic needing asynchronous thread processing only due to time consumption, a huge middleware component is added, which is unreasonable, and the problem of high resource occupation when the engineering system processes asynchronous transactions can be caused.
In view of the above problem, in one embodiment, as shown in fig. 4, an asynchronous transaction processing method is provided, which is described by taking the method as an example applied to a computer device, and includes the following steps:
101. monitoring the execution condition of an asynchronous method for processing asynchronous transactions in the microservice application system, wherein the asynchronous method has preset annotation information which comprises execution annotation.
The micro service application system can be a computer system or an engineering system used by a user. Meanwhile, before executing the method provided by the present embodiment, basic resource information about executing the method needs to be imported into the microservice application system. Firstly, a spring-related jar file is introduced into a micro-service application system, wherein the spring framework is a J2EE application program framework of open source codes and is a lightweight container for managing the lifecycle of bean, and the jar file (Java Archive) is a software package file format and is generally used for aggregating a large number of Java class files, related metadata and resource files into one file so as to develop Java platform application software or a library. And then, the system starts a declarative transaction to realize transaction control by taking the method as a unit. Then, the micro service application system introduces jar files containing basic resource information for executing the method, and adds annotation information @ MiceDelay on a specified asynchronous method, wherein, for the necessary asynchronous method which does not allow the failed asynchronous transaction to be executed, the execution annotation in the annotation information can be set on the asynchronous method, which is used for indicating the system to lock the asynchronous method when processing the transaction, and providing an execution object for subsequent work. Wherein, when the annotation information is an execution annotation, the save identifier in the annotation information @ MiceDelay may correspond to "yes", i.e., "Y", to mark the necessary asynchronous method that does not allow the failed asynchronous transaction to be executed.
Specifically, the execution condition of the asynchronous method for processing the asynchronous transaction is detected in real time, wherein the execution condition comprises successful execution and failed execution, and meanwhile, the annotation information set on the asynchronous method is monitored, and whether the save identifier in the annotation information @ MiceDelay is corresponding to 'Y' is judged.
102. And judging whether the asynchronous method is successfully executed or not, and judging whether the annotation information of the asynchronous method is an execution annotation or not.
Specifically, after the main thread is processed, the asynchronous transaction is started to be executed, error information returned by the asynchronous method can be acquired to judge whether the asynchronous method is successfully executed, and annotation information set on the asynchronous method can be identified and judged whether the annotation information is execution annotation or not under the condition that the asynchronous method is failed to be executed. Meanwhile, an execution failure identifier can be set in the execution failure asynchronous method, so that the subsequent identification work is facilitated.
103. And if the execution of the asynchronous method fails and the annotation information of the asynchronous method is the execution annotation, storing the asynchronous method into a database.
Specifically, when the asynchronous method fails to be executed and the annotation information @ MiceDelay (save = "Y") of the asynchronous method, the information corresponding to the asynchronous method which fails to be executed is stored in the storage queue of the database and serves as delay information, so that the asynchronous method can be scheduled to be executed again at a later timing. Meanwhile, after the information corresponding to the asynchronous method is stored in the storage queue of the database, the information which enters the delay mechanism proxy class can be returned to the main thread.
104. Scheduling and executing the asynchronous method from the database.
Specifically, the delay information may be retrieved from the database of the system for execution again based on a preset time interval or in response to a user's execution operation, so as to execute an asynchronous method and complete an asynchronous transaction.
The invention provides an asynchronous transaction processing method, which comprises the steps of setting annotation information in an asynchronous method of an asynchronous transaction, judging whether the asynchronous transaction corresponding to the asynchronous method is the asynchronous transaction which needs to be successfully executed or not based on the annotation information when the asynchronous method fails to be executed, judging that the asynchronous transaction corresponding to the asynchronous method is the necessary asynchronous transaction which needs to be successfully processed if the annotation information of the asynchronous method is execution annotation, storing the asynchronous method into a database as delay information, and scheduling and executing the asynchronous method from the database when a computing resource is idle. According to the technical scheme, annotation information is added into the asynchronous method, the asynchronous method is stored and called based on the queue in the database, and the asynchronous transaction is processed, so that the technical scheme is neat and clear in framework and simple in setting, the asynchronous transaction can be successfully processed under the condition that a message middleware is not required to be set, and occupied resources of an engineering system are effectively reduced when the asynchronous transaction is solved. Meanwhile, the technical scheme of the application can adapt to most system scenes, and has strong expansibility.
In one embodiment, step 104 may be implemented by: first, the number of microservice application systems executing the asynchronous method is identified. Specifically, for an asynchronous transaction across systems, the asynchronous transaction needs to be executed by main threads of multiple micro service application systems, and the number of micro service application systems can be determined based on the number of micro service application systems to which the main threads executing the asynchronous transaction belong. And if the number of the micro service application systems is more than or equal to two, acquiring interface calling information between the micro service application systems. Specifically, when the number of the micro service application systems executing the asynchronous transaction is more than one, the executed asynchronous transaction can be considered as a cross-system asynchronous transaction, so that interface call information between the micro service application systems is obtained, and a basic condition is provided for subsequently establishing logic of asynchronous thread processing. Then, based on the interface calling information, a cross-system processing interface between the micro service application systems is established, so that the logic of asynchronous thread processing is established. Finally, based on the cross-system processing interface, the asynchronous method is scheduled from a database of the microservice application system and executed. The embodiment can realize the execution of the cross-system asynchronous transaction based on the cross-system processing logic established by the cross-system processing interface.
In one embodiment, step 104 may also be implemented by: and carrying out data detection on the database based on a preset detection interval. The detection interval may be set based on actual conditions, and is used to detect whether information corresponding to the asynchronous method exists in the database at regular time, that is, to determine whether delay information exists. Specifically, when an asynchronous transaction is processed, whether delay information exists in the database can be detected at regular time based on a scheduling mechanism introduced across system processing interfaces. And if the data information corresponding to the asynchronous method exists in the database, scheduling and executing the asynchronous method from the database. Specifically, based on the introduced scheduling mechanism, the asynchronous method for executing the asynchronous transaction which has failed to be executed previously through the delay information stored in the database by the timing scheduling can enable the asynchronous transaction to be successfully processed, thereby ensuring the atomicity of the asynchronous transaction request data.
In one embodiment, the annotation information further comprises a default annotation, wherein the default annotation is used to tag unnecessary asynchronous methods that are allowed to fail execution among the asynchronous methods. The default annotation may be in the specific form that save corresponding to @ MiceDelay is null. When the asynchronous thread processing method of the same system is carried out, the asynchronous method of the asynchronous transaction is judged to be an unnecessary asynchronous method, namely the asynchronous transaction is allowed to fail, such as unimportant processing logic, log recording, mail sending and the like. Default annotations may be set in advance on the asynchronous method of the asynchronous transaction for system identification. Further, before the storing the asynchronous method in the database, the method further comprises: and if the asynchronous method fails to execute and the annotation information of the asynchronous method is a default annotation, discarding the asynchronous method. Specifically, if the annotation information of the identified asynchronous method with failed execution is the default annotation, that is, save is empty, the asynchronous method can default to asynchronous execution, and the delay information is not stored in the database after the execution fails, and meanwhile, the asynchronous method does not need to be executed again. In embodiments of the present application, default annotations may be set on unnecessary asynchronous methods in advance, and discarded after the asynchronous methods fail to execute, so as to save computing resources.
In one embodiment, after step 104, the asynchronous transaction processing method may further include the following steps: if the asynchronous method fails to be executed, the step in the step 103 is executed again until the asynchronous method is executed successfully. Specifically, if the delay information retrieved from the store queue fails to be executed again, the delay information is stored in the store queue again to wait for the next processing. In the embodiment of the present application, if the execution of the delay information fails, the delay information is stored in the database, and the scheduling mechanism is waited to be invoked again and executed after the next detection interval. If the execution fails again, the steps are repeated until the execution of the delay information is successful, and the atomicity of the transaction is ensured.
In one embodiment, step 101 may be implemented by: firstly, a section programming is set, and the asynchronous method with the annotation information is packaged in a section agent of the section programming. The service logic is a technique for realizing unified maintenance of program functions through a pre-compiling mode and a dynamic proxy during running, and each part of the service logic can be isolated, and additional functions are added under the condition that source codes of each service logic are not modified, so that the coupling degree between each part of the service logic is reduced, the reusability of a program is improved, and the development efficiency is improved. Specifically, when the application is started, an AOP is generated, and the asynchronous method with annotation information is packaged in the spring tangent plane proxy class, so that a monitoring function can be added for the asynchronous method without modifying the source code. Then, the execution condition of the asynchronous method in the tangent plane proxy is monitored. Specifically, the asynchronous method with annotation information in the proxy class is monitored, and if the asynchronous method of the asynchronous transaction fails to execute and the asynchronous method has an execution annotation, the request data of the asynchronous transaction and the asynchronous method packing object are placed in a delay queue to wait for being executed again. If the asynchronous method of the asynchronous transaction fails to execute and the asynchronous method has a default annotation, the request data of the asynchronous transaction and the asynchronous method are discarded. In the embodiment of the application, the asynchronous method is monitored by setting the section programming mode, and the monitoring function is added to the asynchronous transaction execution method under the condition that the source code of the processing logic of the asynchronous transaction execution method is not modified, so that the working efficiency is improved, and the code is kept neat.
In one embodiment, the asynchronous transaction processing method may further include the following steps: and performing data detection on the database based on a preset detection interval, and if data information corresponding to the asynchronous method exists in the database, sending alarm prompt information. Specifically, the delay information stored in the database can be scheduled regularly based on the detection interval, when the delay information stored in the database is found, an alarm prompt message is sent out, an engineer is informed to check the condition of execution failure of the asynchronous method, and the reason is found and processed in time.
The asynchronous transaction processing method provided in the foregoing embodiment sets annotation information in an asynchronous method of an asynchronous transaction, monitors an execution condition of the asynchronous method based on a tangent plane programming, determines whether the asynchronous transaction corresponding to the asynchronous method is an asynchronous transaction that must be successfully executed based on the annotation information when the asynchronous method fails to be executed, determines that the asynchronous transaction corresponding to the asynchronous method is an asynchronous transaction that must be successfully executed if the annotation information of the asynchronous method is the execution annotation, stores the asynchronous method in a database as delay information, schedules and executes the asynchronous method from the database based on a preset time interval or when a resource to be calculated is idle, and notifies an engineer to find a failure reason in time when the asynchronous method fails to be executed. According to the technical scheme, annotation information is added in the asynchronous method, the asynchronous method is stored and called based on the queue in the database, and processing of the asynchronous transaction is completed, so that the technical scheme is clean and clear in framework and simple in setting, the asynchronous transaction can be guaranteed to be successfully executed under the condition that a message middleware is not required to be set, and occupied resources are effectively reduced when the asynchronous transaction is solved by an engineering system. Meanwhile, the technical scheme of the application can be suitable for most system scenes, has strong expansibility, can distinguish unnecessary asynchronous methods from necessary asynchronous methods in the system, does not waste excessive resources aiming at the unnecessary asynchronous methods, has safety and stability aiming at the necessary asynchronous methods, can be freely set based on actual conditions, and is efficient and flexible.
Further, as a specific implementation of the method shown in fig. 4, this embodiment provides an asynchronous transaction processing apparatus, as shown in fig. 5, the apparatus includes: the data monitoring module 51, the data judging module 52, the data calling module 53 and the data executing module 54.
A data monitoring module 51, configured to monitor an execution condition of an asynchronous method for processing an asynchronous transaction in the microservice application system, where the asynchronous method has pre-set annotation information, and the annotation information includes an execution annotation;
a data determining module 52, configured to determine whether the asynchronous method is successfully executed, and determine whether the annotation information of the asynchronous method is an execution annotation;
a data retrieving module 53, configured to store the asynchronous method in a database if the asynchronous method fails to be executed and the annotation information of the asynchronous method is an execution annotation;
a data execution module 54 operable to schedule and execute the asynchronous methods from the database.
In a specific application scenario, the data monitoring module 51 may be specifically configured to set a section program, and package the asynchronous method with the annotation information in a section agent of the section program; and monitoring the execution condition of the asynchronous method in the tangent plane proxy.
In a specific application scenario, the data execution module 54 is specifically configured to identify the number of microservice application systems executing the asynchronous method; if the number of the micro service application systems is more than or equal to two, acquiring interface calling information between the micro service application systems; establishing a cross-system processing interface between the micro-service application systems based on the interface calling information; scheduling the asynchronous method from a database of the microservice application system and executing the asynchronous method based on the cross-system processing interface.
In a specific application scenario, the data execution module 54 may be further specifically configured to perform data detection on the database based on a preset detection interval; and if the data information corresponding to the asynchronous method exists in the database, scheduling and executing the asynchronous method from the database.
In a specific application scenario, the data execution module 54 may be further specifically configured to send an alarm prompt message if data information corresponding to an asynchronous method exists in the database.
Further, the annotation information further includes a default annotation, and in a specific application scenario, as shown in fig. 6, the apparatus further includes a discard execution module 63, which is specifically configured to discard the asynchronous method if the asynchronous method fails to be executed and the annotation information of the asynchronous method is the default annotation.
In a specific application scenario, the apparatus further includes an execution rotation module 66, which is specifically configured to, if the execution of the asynchronous method fails, execute the step of storing the asynchronous method in the database if the execution of the asynchronous method fails and the annotation information of the asynchronous method is an execution annotation again until the execution of the asynchronous method succeeds.
It should be noted that other corresponding descriptions of the functional units involved in the asynchronous transaction processing apparatus provided in this embodiment may refer to the corresponding descriptions in fig. 4, and are not described herein again.
Based on the method shown in fig. 4, correspondingly, the present embodiment further provides a storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the asynchronous transaction processing method shown in fig. 4.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, and the software product to be identified may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, or the like), and include several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the method according to the implementation scenarios of the present application.
Based on the method shown in fig. 4 and the embodiments of the asynchronous transaction processing apparatus shown in fig. 5 and 6, in order to achieve the above object, this embodiment further provides an entity device for asynchronous transaction processing, which may specifically be a personal computer, a server, a smart phone, a tablet computer, a smart watch, or other network devices, and the entity device includes a storage medium and a processor; a storage medium for storing a computer program; a processor for executing a computer program for implementing the above-described method as shown in fig. 4.
Optionally, the entity device may further include a user interface, a network interface, a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, and the like. The user interface may include a Display screen (Display), an input unit such as a keypad (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), etc.
It can be understood by those skilled in the art that the physical device structure of an asynchronous transaction provided in this embodiment does not constitute a limitation to the physical device, and may include more or fewer components, or combine some components, or arrange different components.
The storage medium may further include an operating system and a network communication module. The operating system is a program for managing the hardware of the above-mentioned entity device and the software resources to be identified, and supports the operation of the information processing program and other software and/or programs to be identified. The network communication module is used for realizing communication among components in the storage medium and communication with other hardware and software in the information processing entity device.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by software plus a necessary general hardware platform, and can also be implemented by hardware. By applying the technical scheme of the application, firstly, the execution condition of an asynchronous method for processing asynchronous transactions in the microservice application system is monitored, wherein the asynchronous method has preset annotation information, and the annotation information comprises execution annotation; then, judging whether the asynchronous method is successfully executed or not, and judging whether annotation information of the asynchronous method is execution annotation or not; if the asynchronous method fails to be executed and the annotation information of the asynchronous method is an execution annotation, storing the asynchronous method in a database; finally, the asynchronous method is scheduled and executed from the database. Compared with the prior art, the method completes the processing of the asynchronous transaction based on adding annotation information in the asynchronous method and storing and calling the asynchronous method based on the queue in the database, so that the technical scheme has the advantages of neat and clear framework and simple setting, can ensure the successful execution of the asynchronous transaction under the condition of not needing to set a message middleware, and effectively reduces the occupied resources when an engineering system solves the asynchronous transaction. Meanwhile, the technical scheme of the application can be suitable for most system scenes, has strong expansibility, can distinguish unnecessary asynchronous methods from necessary asynchronous methods in the system, does not waste excessive resources aiming at the unnecessary asynchronous methods, has safety and stability aiming at the necessary asynchronous methods, can be freely set based on actual conditions, and is efficient and flexible.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial number is merely for description and does not represent the superiority and inferiority of the implementation scenario. The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.

Claims (10)

1. An asynchronous transaction processing method applied to a microservice application system, the method comprising:
monitoring the execution condition of an asynchronous method for processing asynchronous transactions in the microservice application system, wherein the asynchronous method has preset annotation information which comprises execution annotation;
judging whether the asynchronous method is successfully executed or not, and judging whether annotation information of the asynchronous method is execution annotation or not;
if the asynchronous method fails to be executed and the annotation information of the asynchronous method is an execution annotation, storing the asynchronous method in a database;
scheduling and executing the asynchronous method from the database.
2. The method of claim 1, wherein scheduling and executing the asynchronous method from the database comprises:
identifying a number of the microservice application systems executing the asynchronous method;
if the number of the micro service application systems is more than or equal to two, acquiring interface calling information between the micro service application systems;
establishing a cross-system processing interface between the micro-service application systems based on the interface calling information;
scheduling the asynchronous method from a database of the microservice application system and executing the asynchronous method based on the cross-system processing interface.
3. The method of claim 1, wherein scheduling and executing the asynchronous method from the database further comprises:
performing data detection on the database based on a preset detection interval;
and if the data information corresponding to the asynchronous method exists in the database, scheduling and executing the asynchronous method from the database.
4. The method of claim 1, wherein the annotation information further comprises a default annotation;
before storing the asynchronous method in a database if the asynchronous method fails to execute and the annotation information of the asynchronous method is an execution annotation, the method further comprises:
and if the asynchronous method fails to execute and the annotation information of the asynchronous method is a default annotation, discarding the asynchronous method.
5. The method of any of claims 1-4, wherein after scheduling and executing the asynchronous method from the database, the method further comprises:
and if the asynchronous method fails to be executed, executing the step of storing the asynchronous method in the database again until the asynchronous method is successfully executed, wherein the asynchronous method fails to be executed and annotation information of the asynchronous method is execution annotation.
6. The method of any of claims 1-4, wherein monitoring execution of the asynchronous method for processing asynchronous transactions in the microservice application system comprises:
setting a section programming, and packaging the asynchronous method with the annotation information in a section agent of the section programming;
and monitoring the execution condition of the asynchronous method in the tangent plane proxy.
7. The method of claim 3, wherein after the detecting the data in the database based on the preset detection interval, the method further comprises:
and if the data information corresponding to the asynchronous method exists in the database, sending alarm prompt information.
8. An asynchronous transaction processing apparatus, the apparatus comprising:
the data monitoring module is used for monitoring the execution condition of an asynchronous method for processing asynchronous transactions in the microservice application system, wherein the asynchronous method has preset annotation information, and the annotation information comprises execution annotation;
the data judgment module is used for judging whether the asynchronous method is successfully executed and judging whether the annotation information of the asynchronous method is an execution annotation;
the data calling module is used for storing the asynchronous method into a database if the asynchronous method fails to be executed and the annotation information of the asynchronous method is an execution annotation;
and the data execution module is used for scheduling and executing the asynchronous method from the database.
9. A storage medium on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
10. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 7 when executed by the processor.
CN202211114478.8A 2022-09-14 2022-09-14 Asynchronous transaction processing method and device, storage medium and computer equipment Pending CN115499493A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211114478.8A CN115499493A (en) 2022-09-14 2022-09-14 Asynchronous transaction processing method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211114478.8A CN115499493A (en) 2022-09-14 2022-09-14 Asynchronous transaction processing method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN115499493A true CN115499493A (en) 2022-12-20

Family

ID=84468900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211114478.8A Pending CN115499493A (en) 2022-09-14 2022-09-14 Asynchronous transaction processing method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN115499493A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116643733A (en) * 2023-07-26 2023-08-25 北京仁科互动网络技术有限公司 Service processing system and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116643733A (en) * 2023-07-26 2023-08-25 北京仁科互动网络技术有限公司 Service processing system and method
CN116643733B (en) * 2023-07-26 2023-10-13 北京仁科互动网络技术有限公司 Service processing system and method

Similar Documents

Publication Publication Date Title
US20190303779A1 (en) Digital worker management system
CN105357038B (en) Monitor the method and system of cluster virtual machine
CN107729139B (en) Method and device for concurrently acquiring resources
US11544137B2 (en) Data processing platform monitoring
US6643802B1 (en) Coordinated multinode dump collection in response to a fault
CN103201724B (en) Providing application high availability in highly-available virtual machine environments
CN110231995B (en) Task scheduling method, device and storage medium based on Actor model
EP3591485B1 (en) Method and device for monitoring for equipment failure
CN111897633A (en) Task processing method and device
CN111858007A (en) Task scheduling method and device based on message middleware
CN114398179B (en) Method and device for acquiring tracking identifier, server and storage medium
CN115964153A (en) Asynchronous task processing method, device, equipment and storage medium
CN115499493A (en) Asynchronous transaction processing method and device, storage medium and computer equipment
CN113157411B (en) Celery-based reliable configurable task system and device
CN113364857A (en) Service data processing method and device and server
CN113760491A (en) Task scheduling system, method, equipment and storage medium
CN113190427A (en) Caton monitoring method and device, electronic equipment and storage medium
CN110764962A (en) Log processing method and device
CN111831408A (en) Asynchronous task processing method and device, electronic equipment and medium
CN112231073A (en) Distributed task scheduling method and device
CN107632893B (en) Message queue processing method and device
CN111324668B (en) Database data synchronous processing method, device and storage medium
CN114237891A (en) Resource scheduling method and device, electronic equipment and storage medium
CN114691445A (en) Cluster fault processing method and device, electronic equipment and readable storage medium
JP6555908B2 (en) Information processing apparatus, control method therefor, and program

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