A distributed transaction processing method based on microservice architecture
By introducing business management and execution units into the microservice architecture and combining it with self-judgment and feedback design, the problems of high usage threshold and low efficiency of transaction processing in the microservice architecture are solved, and an efficient and reasonable transaction processing process is achieved.
Patent Information
- Application Number
- CN202210046079.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-01-17
AI Technical Summary
The transaction processing method based on the microservice architecture in the existing technology has a high threshold for use and is difficult to promote and use, especially in the cross-system transaction processing.
It adopts business management units, business execution preparation units and business execution units, including business reception, analysis, classification, matching and execution units. Through self-judgment and feedback design, it lowers the usage threshold, and improves processing efficiency through time limit of execution judgment unit and information database synchronization.
It realizes self-retrieval and feedback, lowers the usage threshold, improves the efficiency and accuracy of transaction processing, reduces the problem of long judgment and analysis time caused by information exceeding the scope, and ensures the rationality and efficiency of business information processing.
Smart Images

Figure CN114528072B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of transaction processing, and in particular to a distributed transaction processing method based on a microservice architecture. Background Art
[0002] Microservices is a software development technique, a variation of the Service-Oriented Architecture (SOA) architectural style. It advocates dividing a single application into a set of small services that coordinate and collaborate with each other to deliver ultimate value to users. Each service runs in its own independent process, communicating with each other using lightweight mechanisms (typically RESTful APIs over HTTP). Each service is built around a specific business and can be independently deployed in production or production-like environments. Furthermore, a unified, centralized service management mechanism should be avoided. For each service, appropriate languages and tools should be selected based on the context.
[0003] In microservices, systems are divided into several subsystems. When a single instance requires execution across multiple subsystems, distributed transactions are necessary to ensure consistency across the entire process. For example, the order and payment process on a typical shopping website involves at least the transaction system and the payment system, and strong consistency must be ensured throughout the entire process. Because the participants, transaction-supporting servers, resource servers, and transaction managers in distributed transactions are located on different nodes in different systems, implementing distributed transactions presents significant obstacles.
[0004] In the existing technology, the sub-item processing flow of the transaction processing method based on the microservice architecture generally adopts a direct corresponding processing method, which requires users to learn the category of the service processing flow in advance. There is a high usage threshold for the elderly and children, which is not convenient for the promotion and use of the service. Summary of the Invention
[0005] The purpose of the present invention is to solve the shortcomings of the existing technology and propose a distributed transaction processing method based on a microservice architecture.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A distributed transaction processing method based on a microservice architecture includes a business management unit, a business execution preparation unit, and a business execution unit. The business management unit includes a business receiving unit for receiving and distributing business messages, a business status storage unit for recording the initial business processing status, and a business feedback unit for providing feedback on the business processing status. The business execution preparation unit includes a business parsing unit for analyzing business content, an execution determination unit for determining whether the business can be executed, a business classification unit for specifically classifying business content, and an execution unit matching unit for matching the business content with a corresponding execution unit. The business execution unit includes a business execution unit for executing the business and a business execution result feedback unit for providing feedback on the business execution result. The method further includes the following steps:
[0008] S1, the service receiving unit receives service information and passes the service information to the service parsing unit, which parses the service information content;
[0009] S2, then passing the business information and the parsed content to the execution determination unit for determination. If it is determined to be executable, the business information is passed to the business classification unit, which classifies the business information.
[0010] S3. The classified business information is transmitted to the execution unit matching unit, which selects the corresponding business execution unit;
[0011] S4. The service information is transmitted to the service execution unit for execution, and the execution result is transmitted to the service execution result feedback unit.
[0012] Preferably, in step S2, when the execution determination unit determines that the bit is not executable, the determination result is passed to the business status storage unit, and at the same time, the execution determination unit passes the determination result to the business feedback unit to perform preliminary processing result feedback of the business information.
[0013] Preferably, in step S2, while the business information is passed to the business classification unit, the execution judgment unit passes the processable judgment result to the business status storage unit for storage, and at the same time passes the judgment result to the business feedback unit for feedback of the preliminary processing result of the business information.
[0014] Preferably, the operation time of the execution judgment unit is preset. When the operation time exceeds the preset time threshold, the operation status is detected by querying the log file in the business status storage unit, and the execution of the judgment is terminated at the same time, and the process obstruction feedback is provided through the business feedback unit.
[0015] Preferably, after the execution is completed, the execution information of the business feedback unit and the business execution result feedback unit are integrated and stored.
[0016] Preferably, the execution unit category information in the execution unit matching unit is a matching reference database of the business classification unit.
[0017] Preferably, the content analysis basis of the business parsing unit is established based on the execution unit category information.
[0018] Preferably, the category information of the business execution unit provides a data basis for the matching database of the execution unit matching unit.
[0019] The beneficial effects of the present invention are:
[0020] 1. This invention further self-diagnoses and classifies sub-items in the distributed transaction processing process based on the microservice architecture, and with the information feedback design, it enables self-search and feedback, which lowers the user threshold and makes the invention very easy to promote;
[0021] 2. The service status storage unit receives the judgment result information from the execution ability judgment unit and uses it as a node to record the processing progress and generate a log file. At the same time, the service receiving unit interacts with the service status storage unit in a one-way manner when receiving service information. The service information is synchronously transmitted to the service status storage unit for storage. The designed execution ability judgment unit determines whether the service information content can be processed. The service parsing unit, service classification unit, and execution unit matching unit parse, classify, and match the service content, making the processing of service content more reasonable and efficient.
[0022] 3. By feeding back and storing the output information of the execution judgment unit, users can easily view the progress of the business processing process and receive preliminary processing results in a timely manner, making the processing of transactions more efficient;
[0023] 4. By limiting the processing time of the execution judgment unit, the probability of excessive judgment and analysis time due to business information exceeding the scope, thereby reducing the probability of processing efficiency;
[0024] 5. By synchronizing the basic information of the basic information bases of the business execution unit, execution unit matching unit, business classification unit and business analysis unit, the information in the basic information bases of the above units can correspond to each other, avoiding the situation where business information cannot be processed due to database content mismatch. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1This is a flow chart of a distributed transaction processing method based on a microservice architecture according to the present invention. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0027] Example 1
[0028] like Figure 1 As shown, a distributed transaction processing method based on a microservice architecture includes a business management unit, a business execution preparation unit and a business execution unit. The business management unit includes a business receiving unit for receiving and distributing business messages, a business status storage unit for recording the preliminary processing status of the business and a business feedback unit for providing feedback on the business processing status. The business execution preparation unit includes a business parsing unit for analyzing the business content, an execution judgment unit for judging whether the business can be executed, a business classification unit for specifically classifying the business content and an execution unit matching unit for matching the business content with the corresponding execution unit. The business execution unit includes a business execution unit for executing the business and a business execution result feedback unit for providing feedback on the business execution result.
[0029] In this embodiment, the business status storage unit receives the judgment result information from the executable judgment unit, and uses this as a node to record the processing progress and generate a log file. At the same time, the business receiving unit interacts with the business status storage unit in a one-way manner when receiving business information, and the business information is synchronously transmitted to the business status storage unit for storage. The designed executable judgment unit is used to judge whether the business information content can be processed, and the business content is parsed, classified and matched through the business parsing unit, the business classification unit and the execution unit matching unit, so that the processing of the business content is more reasonable and efficient.
[0030] Example 2
[0031] like Figure 1 As shown, a distributed transaction processing method based on a microservice architecture further includes the following steps:
[0032] S1. The service receiving unit receives service information and transmits the service information to the service parsing unit, which then parses the service information.
[0033] S2, and then pass the business information and the parsed content to the execution judgment unit for judgment. When it is judged to be executable, the business information is passed to the business classification unit, and the business classification unit classifies the business information. At the same time, the execution judgment unit passes the processable judgment result to the business status storage unit for storage, and passes the judgment result to the business feedback unit for feedback of the preliminary processing result of the business information; when the execution judgment unit judges that it is not executable, the judgment result is passed to the business status storage unit, and at the same time, the execution judgment unit passes the judgment result to the business feedback unit for feedback of the preliminary processing result of the business information.
[0034] S3. The classified business information is transmitted to the execution unit matching unit, which selects the corresponding business execution unit.
[0035] S4. The service information is transmitted to the service execution unit for execution, and the execution result is transmitted to the service execution result feedback unit.
[0036] In this embodiment, by feeding back and storing the output information of the execution determination unit, users can conveniently view the progress of the business processing flow and receive preliminary processing result information in a timely manner, making the processing of transactions more efficient.
[0037] Example 3
[0038] like Figure 1 As shown, the operation time of the execution judgment unit is preset. When the operation time exceeds the preset time threshold, the operation status is detected by querying the log file in the business status storage unit, and the execution judgment is terminated at the same time, and the process obstruction feedback is provided through the business feedback unit.
[0039] In this embodiment, by limiting the processing time of the execution determination unit, the probability of a situation where the judgment and analysis time is too long due to business information exceeding the scope, thereby reducing the processing efficiency, is reduced.
[0040] Example 4
[0041] like Figure 1 As shown, after the execution is completed, the execution information of the business feedback unit and the business execution result feedback unit are integrated and stored.
[0042] In this embodiment, it is convenient for administrators to view the historical records of business information processing.
[0043] Example 5
[0044] like Figure 1As shown, the execution unit category information in the execution unit matching unit is the matching reference database of the business classification unit; the content analysis basis of the business parsing unit is established based on the execution unit category information; the category information of the business execution unit provides a data basis for the matching database of the execution unit matching unit.
[0045] In this embodiment, by synchronizing the basic information of the basic information bases of the business execution unit, execution unit matching unit, business classification unit and business analysis unit, the information in the basic information bases of the above units can correspond to each other, avoiding the situation where business information cannot be processed due to database content mismatch.
[0046] Working principle: When the present invention is in use, the business receiving unit first receives the business information, and then transmits the business information to the business parsing unit, which parses the business information and then transmits it to the execution judgment unit. The execution judgment unit analyzes and judges the parsed business information. If it exceeds the category range of the business execution unit, it is determined to be business information that cannot be executed, and the judgment information is transmitted to the business status storage unit for storage and the business feedback unit for preliminary processing result feedback of the business information. If it does not exceed the category range of the business execution unit, the business information is transmitted to the business classification unit for specific classification. After the classification is completed, the execution unit matching unit matches the corresponding business execution unit. After the matching is completed, the corresponding business execution unit processes the business information, and after the processing is completed, the business execution result feedback unit feedbacks the information processing result.
[0047] The service status storage unit receives the judgment result information from the judgment unit and uses it as a node to record the processing progress and generate a log file. At the same time, the service receiving unit performs a one-way interaction with the service status storage unit when receiving service information, and the service information is synchronously transmitted to the service status storage unit for storage;
[0048] The preset time threshold in the judgment unit is whether it can be executed. The timing starts when it receives the business information from the business analysis unit, and stops when it transmits information to the outside. When it exceeds the time threshold and still does not send information, it stops judging the business information, and transmits status information to the business status storage unit and the judgment result information to the business feedback unit.
[0049] Comparative Example 1
[0050] The method of this embodiment is substantially the same as that of the provided embodiments 1-5, with the main difference being that: in embodiment 1, no service classification unit is provided;
[0051] Comparative Example 2
[0052] The method of this embodiment is substantially the same as that of the provided embodiments 1-5, with the main difference being that the judgment time threshold is not preset in embodiment 3.
[0053] Comparative Example 3
[0054] The method of this embodiment is substantially the same as that of the provided embodiments 1-5, with the main difference being that in embodiment 5, the category information of the business execution unit is not used as the data basis for the matching database of the execution unit matching unit.
[0055] Performance Testing
[0056] The accuracy and processing efficiency of the distributed transaction processing methods based on the microservice architecture provided by Examples 1-5 and Comparative Examples 1-3 are respectively taken as follows:
[0057] accuracy Processing efficiency Example 1 99.9% 99.9% Comparative Example 1 80% 85% Comparative Example 2 90% 50% Comparative Example 3 95% 30%
[0058] By analyzing the relevant data in the above tables, it can be seen that through the present invention,
[0059] A distributed transaction processing method based on a microservice architecture includes a business management unit, a business execution preparation unit, and a business execution unit. The business management unit includes a business receiving unit for receiving and distributing business messages, a business status storage unit for recording the initial processing status of the business, and a business feedback unit for providing feedback on the business processing status. The business execution preparation unit includes a business parsing unit for analyzing business content, an execution determination unit for determining whether the business can be executed, a business classification unit for specifically classifying business content, and an execution unit matching unit for matching the business content with a corresponding execution unit. The business execution unit includes a business execution unit for executing the business and a business execution unit for providing feedback on the business execution results. The business execution result feedback unit presets the operation time of the execution judgment unit. When the operation time exceeds the preset time threshold, the operation status is detected by querying the log file in the business status storage unit, and the execution judgment is suspended at the same time. The process is blocked and feedback is given through the business feedback unit. After the execution is completed, the execution information of the business feedback unit and the business execution result feedback unit are integrated and stored to facilitate the administrator to view the historical records of business information processing. The execution unit category information in the execution unit matching unit is the matching benchmark database of the business classification unit; the content analysis basis of the business parsing unit is established based on the execution unit category information; the category information of the business execution unit provides a data basis for the matching database of the execution unit matching unit;
[0060] The business status storage unit receives the judgment result information from the executable judgment unit, and uses this as a node to record the processing progress and generate a log file. At the same time, the business receiving unit interacts with the business status storage unit in a one-way manner when receiving business information, and the business information is synchronously transmitted to the business status storage unit for storage. The designed executable judgment unit is used to judge whether the business information content can be processed, and the business content is parsed, classified and matched through the business analysis unit, the processing of the business content is more reasonable and efficient, and by limiting the processing time of the executable judgment unit, the probability of the judgment and analysis time being too long due to the business information exceeding the scope is reduced, thereby reducing the processing efficiency. Moreover, by synchronizing the basic information of the basic information base of the business execution unit, the execution unit matching unit, the business classification unit and the business analysis unit, the information in the basic information base of the above units can correspond to each other, avoiding the situation where the business information cannot be processed due to database content mismatch.
[0061] And the present invention also comprises the following steps:
[0062] S1. The service receiving unit receives service information and transmits the service information to the service parsing unit, which then parses the service information.
[0063] S2, and then pass the business information and the parsed content to the execution judgment unit for judgment. When it is judged to be executable, the business information is passed to the business classification unit, and the business classification unit classifies the business information. At the same time, the execution judgment unit passes the processable judgment result to the business status storage unit for storage, and passes the judgment result to the business feedback unit for feedback of the preliminary processing result of the business information; when the execution judgment unit judges that it is not executable, the judgment result is passed to the business status storage unit, and at the same time, the execution judgment unit passes the judgment result to the business feedback unit for feedback of the preliminary processing result of the business information.
[0064] S3. The classified business information is transmitted to the execution unit matching unit, which selects the corresponding business execution unit.
[0065] S4. The service information is transmitted to the service execution unit for execution, and the execution result is transmitted to the service execution result feedback unit.
[0066] The above design feeds back and stores the output information of the execution judgment unit, making it convenient for users to view the progress of the business processing flow and receive preliminary processing result information in a timely manner, making the processing of transactions more efficient.
[0067] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A distributed transaction processing method based on microservice architecture, characterized in that: The system comprises a business management unit, a business execution preparation unit and a business execution unit, wherein the business management unit comprises a business receiving unit for receiving and distributing business messages, a business status storage unit for recording the preliminary processing status of the business and a business feedback unit for providing feedback on the business processing status; the business execution preparation unit comprises a business parsing unit for analyzing business content, an execution determination unit for determining whether the business can be executed, a business classification unit for specifically classifying business content and an execution unit matching unit for matching the business content with a corresponding execution unit; the business execution unit comprises a business execution unit for executing the business and a business execution result feedback unit for providing feedback on the business execution result; and further comprises the following steps: S1, the service receiving unit receives service information and passes the service information to the service parsing unit, and the service parsing unit parses the service information content; S2, then passing the business information and the parsed content to the execution determination unit for determination. If it is determined to be executable, the business information is passed to the business classification unit, which classifies the business information. When the execution determination unit determines that the service is not executable, the determination result is transmitted to the service status storage unit. At the same time, the execution determination unit transmits the determination result to the service feedback unit to provide feedback on the preliminary processing result of the service information. While transmitting the service information to the service classification unit, the execution determination unit transmits the processable determination result to the service status storage unit for storage, and transmits the determination result to the service feedback unit for feedback of the preliminary processing result of the service information; The operation time of the execution determination unit is preset. When the operation time exceeds the preset time threshold, the operation status is detected by querying the log file in the business status storage unit, and the execution of the determination is suspended. The process is blocked and feedback is provided through the business feedback unit. S3. The classified business information is transmitted to the execution unit matching unit, which selects the corresponding business execution unit; S4. The service information is transmitted to the service execution unit for execution, and the execution result is transmitted to the service execution result feedback unit.
2. A distributed transaction processing method based on microservice architecture according to claim 1, characterized in that: After the execution is completed, the execution information of the business feedback unit and the business execution result feedback unit are integrated and stored.
3. A distributed transaction processing method based on microservice architecture according to claim 1, characterized in that: The execution unit category information in the execution unit matching unit is a matching reference database of the business classification unit.
4. A distributed transaction processing method based on microservice architecture according to claim 1, characterized in that: The content analysis basis of the business parsing unit is established based on the execution unit category information.
5. A distributed transaction processing method based on microservice architecture according to claim 1, characterized in that: The category information of the business execution unit provides a data basis for the matching database of the execution unit matching unit.
Citation Information
Patent Citations
Distributed transaction processing method based on micro service architecture
CN106909467A
Distributed transaction processing method and device
CN108415757A