Business processing method and device of distributed business system and electronic equipment

By introducing an asynchronous framework to handle asynchronous tasks in the non-customer business stage in the distributed business system, the problems of longer business processing time and poor customer experience caused by synchronous processing are solved, and more efficient business processing and better customer experience are achieved.

CN119987955APending Publication Date: 2025-05-13BEIJING PACTERA JINXIN TECH LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510088607.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In distributed core business systems, the existing technology adopts synchronous processing method to cause a longer service processing time and poor customer experience, and subsequent processing errors will lead to back-office of customer services and reduce customer satisfaction.

Method used

A business processing method for distributed business systems is proposed. It handles asynchronous tasks in non-commercial business stages through an asynchronous framework. Event participants are divided into event generators and event consumers, and asynchronous events are published and processed according to the asynchronous processing strategy.

Benefits of technology

Shorten business processing time through asynchronous processing, reduce error rate, improve processing efficiency, improve customer experience, and improve system stability through timed tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987955A_ABST
    Figure CN119987955A_ABST
Patent Text Reader

Abstract

The invention provides a service processing method and device for a distributed service system and electronic equipment, and the method comprises the steps: obtaining a service processing request of a target service, and the target service comprises a customer-facing service stage and a non-customer-facing service stage; processing the task of the target service in the customer service stage to obtain a first processing result; returning a response result of the service processing request based on the first processing result; and processing an asynchronous task of the non-customer service stage of the target service through an asynchronous framework, wherein the asynchronous framework processes the asynchronous task through an asynchronous event driving mode. The asynchronous framework divides event participants for processing an asynchronous task into event generators and event consumers, and for the asynchronous task of a non-customer service stage of a target service, the event producers publish and register asynchronous events according to an asynchronous processing strategy; and processing the asynchronous event through the event consumer, and updating the processing state of the asynchronous event according to the asynchronous processing strategy. According to the invention, the business processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of business processing technology, and in particular to a business processing method, device, electronic device and storage medium for a distributed business system. Background Art

[0002] In the business processing process of the distributed core business system, there are scenarios where customer business has been processed but needs to be processed later. For example, customer business refers to transactions made by customers, such as daily deposits, withdrawals, transfers, payments, collections, and other transactions directly related to customers. Customers need to wait for the actual results to be returned during this transaction. Because customers only care about whether their accounts have received money and whether the deductions are correct. However, for banks, in addition to the correct deductions and collections of money from customer accounts, there are also internal account processing, cross-institutional clearing processing, and processing pushed to the general ledger, as well as processing of whether to send messages according to the contract agreement after the transaction is completed. These internal bank follow-up processing are not necessary for customers to know when they are doing transactions, and the processing of this part of the business should not make customers wait. The existing processing methods are all synchronous processing, that is, the bank's internal follow-up processing is processed together with the actual business of the customer, which will lead to a longer processing time. In addition, if this part of the follow-up processing business reports an error, the completed customer business processing will also need to be rolled back. That is, if the bank's internal follow-up processing fails, the customer business will actually be completed and needs to be rolled back, which greatly reduces the customer experience. Summary of the invention

[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0004] To this end, the first purpose of this application is to propose a business processing method for a distributed business system to improve business processing efficiency and solve the problems of long business processing time and poor customer experience in related technologies.

[0005] The second objective of the present application is to provide a service processing device for a distributed service system.

[0006] The third objective of the present application is to provide an electronic device.

[0007] A fourth objective of the present application is to provide a computer-readable storage medium.

[0008] A fifth object of the present application is to provide a computer program product.

[0009] To achieve the above-mentioned purpose, the first embodiment of the present application proposes a business processing method of a distributed business system, including:

[0010] Obtaining a business processing request for a target business, wherein the target business includes a customer business stage and a non-customer business stage; wherein the customer business stage refers to a business processing stage directly related to the customer business, and the non-customer business stage refers to a business processing stage not directly related to the customer business;

[0011] Processing the task of the customer service stage of the target business to obtain a first processing result; and returning a response result of the business processing request based on the first processing result;

[0012] After returning the response result of the business processing request, the asynchronous task of the non-customer business phase of the target business is processed by the asynchronous framework, and the asynchronous framework processes the asynchronous task in an asynchronous event-driven manner.

[0013] In some implementations, the asynchronous framework divides the event participants that process the asynchronous task into event generators and event consumers, and the asynchronous task of the non-customer business phase of the target business processed by the asynchronous framework includes:

[0014] For the asynchronous tasks of the non-customer business phase of the target business, the event producer publishes and registers asynchronous events according to the asynchronous processing strategy;

[0015] The asynchronous event is processed by the event consumer, and the processing status of the asynchronous event is updated according to the asynchronous processing strategy.

[0016] In some implementations, publishing and registering an asynchronous event according to an asynchronous processing strategy by the event producer includes:

[0017] In response to the processing request of the asynchronous task, setting the asynchronous event information to be processed in the system global context of the distributed business system through the event producer;

[0018] Checking whether there is asynchronous event information in the system global context through the distributed business system; if there is asynchronous event information, the event producer sets the event context, registers the asynchronous event information in the library table, and commits the transaction;

[0019] After the transaction is committed, the asynchronous event information is obtained from the event context through the event producer, and a target asynchronous processing strategy is selected from multiple asynchronous processing strategies according to the business scenario to which the asynchronous task belongs; and the asynchronous event corresponding to the asynchronous event information is processed according to the target asynchronous processing strategy.

[0020] In some implementations, the multiple asynchronous processing strategies include four asynchronous processing strategies, and the four asynchronous processing strategies are respectively the first asynchronous processing strategy to the fourth asynchronous processing strategy, wherein the first asynchronous processing strategy is to register to the library table first and then perform asynchronous processing, the second asynchronous processing strategy is to perform asynchronous processing first and register to the library table after the processing fails, the third asynchronous processing strategy is to only register to the library table, and the fourth asynchronous processing strategy is to only perform asynchronous processing;

[0021] The step of processing the asynchronous event corresponding to the asynchronous event information according to the target asynchronous processing strategy includes:

[0022] When the target asynchronous processing strategy is the first asynchronous processing strategy, the asynchronous event is first registered in a library table by the event producer, and then the asynchronous event is published;

[0023] When the target asynchronous processing strategy is the second asynchronous processing strategy, the asynchronous event is first published by the event producer, and is registered in the library table after the asynchronous event processing fails;

[0024] When the target asynchronous processing strategy is the third asynchronous processing strategy, the asynchronous event is directly registered in the library table by the event producer without publishing the asynchronous event, and the asynchronous event is subsequently completed by a scheduled task;

[0025] When the target asynchronous processing strategy is the fourth asynchronous processing strategy, the event producer only publishes the asynchronous event without registering the library table.

[0026] In some implementations, processing the asynchronous event by the event consumer and updating the processing state of the asynchronous event according to the asynchronous processing strategy includes:

[0027] After the event consumer monitors the asynchronous event published by the event producer, the asynchronous event information is obtained from the event context;

[0028] The event consumer calls the corresponding business processing logic to process the business that needs to be processed by the asynchronous event to obtain a second processing result; and performs subsequent processing according to the second processing result and the target asynchronous processing strategy.

[0029] In some implementations, the subsequent processing includes:

[0030] When the target asynchronous processing strategy is the first asynchronous processing strategy, modifying the asynchronous event record state in the library table through the event consumer;

[0031] When the target asynchronous processing strategy is the second asynchronous processing strategy, checking whether the second processing result fails through the event consumer, and registering the failed asynchronous event information to the library table when it fails;

[0032] When the target asynchronous processing strategy is the first asynchronous processing strategy or the second asynchronous processing strategy, no processing is performed by the event consumer.

[0033] In some implementations, the method further includes:

[0034] In response to the timing task being triggered, the following steps are executed cyclically until there are no asynchronous events to be processed in the library table;

[0035] Instruct the event producer to read the asynchronous events to be processed in the library table;

[0036] When the event producer reads an asynchronous event to be processed, the read asynchronous event to be processed is published according to the target asynchronous processing strategy.

[0037] To achieve the above-mentioned purpose, the second aspect of the present application proposes a service processing device of a distributed service system, including:

[0038] A request acquisition module, used to acquire a business processing request of a target business, wherein the target business includes a customer business stage and a non-customer business stage; wherein the customer business stage refers to a business processing stage directly related to the customer business, and the non-customer business stage refers to a business processing stage not directly related to the customer business;

[0039] A first business processing module, used for processing the tasks of the customer business phase of the target business to obtain a first processing result; and returning a response result of the business processing request based on the first processing result;

[0040] The second business processing module is used to process the asynchronous task of the non-customer business phase of the target business through an asynchronous framework after returning the response result of the business processing request, and the asynchronous framework processes the asynchronous task in an asynchronous event-driven manner.

[0041] In some implementations, the asynchronous framework divides the event participants that process the asynchronous task into event generators and event consumers, and the second business processing module is specifically used to:

[0042] For the asynchronous tasks of the non-customer business phase of the target business, the event producer publishes and registers asynchronous events according to the asynchronous processing strategy;

[0043] The asynchronous event is processed by the event consumer, and the processing status of the asynchronous event is updated according to the asynchronous processing strategy.

[0044] In some implementations, when the second service processing module publishes and registers an asynchronous event according to an asynchronous processing strategy through the event producer, it is configured to:

[0045] In response to the processing request of the asynchronous task, setting the asynchronous event information to be processed in the system global context of the distributed business system through the event producer;

[0046] Checking whether there is asynchronous event information in the system global context through the distributed business system; if there is asynchronous event information, the event producer sets the event context, registers the asynchronous event information in the library table, and commits the transaction;

[0047] After the transaction is committed, the asynchronous event information is obtained from the event context through the event producer, and a target asynchronous processing strategy is selected from multiple asynchronous processing strategies according to the business scenario to which the asynchronous task belongs; and the asynchronous event corresponding to the asynchronous event information is processed according to the target asynchronous processing strategy.

[0048] In some implementations, the multiple asynchronous processing strategies include four asynchronous processing strategies, and the four asynchronous processing strategies are respectively the first asynchronous processing strategy to the fourth asynchronous processing strategy, wherein the first asynchronous processing strategy is to register to the library table first and then perform asynchronous processing, the second asynchronous processing strategy is to perform asynchronous processing first and register to the library table after the processing fails, the third asynchronous processing strategy is to only register to the library table, and the fourth asynchronous processing strategy is to only perform asynchronous processing;

[0049] When the second service processing module processes the asynchronous event corresponding to the asynchronous event information according to the target asynchronous processing strategy, it is used to:

[0050] When the target asynchronous processing strategy is the first asynchronous processing strategy, the asynchronous event is first registered in a library table by the event producer, and then the asynchronous event is published;

[0051] When the target asynchronous processing strategy is the second asynchronous processing strategy, the asynchronous event is first published by the event producer, and is registered in the library table after the asynchronous event processing fails;

[0052] When the target asynchronous processing strategy is the third asynchronous processing strategy, the asynchronous event is directly registered in the library table by the event producer without publishing the asynchronous event, and the asynchronous event is subsequently completed by a scheduled task;

[0053] When the target asynchronous processing strategy is the fourth asynchronous processing strategy, the event producer only publishes the asynchronous event without registering the library table.

[0054] In some implementations, when the second business processing module processes the asynchronous event through the event consumer and updates the processing state of the asynchronous event according to the asynchronous processing strategy, it is configured to:

[0055] After the event consumer monitors the asynchronous event published by the event producer, the asynchronous event information is obtained from the event context;

[0056] The event consumer calls the corresponding business processing logic to process the business that needs to be processed by the asynchronous event to obtain a second processing result; and performs subsequent processing according to the second processing result and the target asynchronous processing strategy.

[0057] In some implementations, the second service processing module is used, during subsequent processing, to:

[0058] When the target asynchronous processing strategy is the first asynchronous processing strategy, modifying the asynchronous event record state in the library table through the event consumer;

[0059] When the target asynchronous processing strategy is the second asynchronous processing strategy, checking whether the second processing result fails through the event consumer, and registering the failed asynchronous event information to the library table when it fails;

[0060] When the target asynchronous processing strategy is the first asynchronous processing strategy or the second asynchronous processing strategy, no processing is performed by the event consumer.

[0061] In some implementations, the second service processing module is further configured to:

[0062] In response to the timing task being triggered, the following steps are executed cyclically until there are no asynchronous events to be processed in the library table;

[0063] Reading the asynchronous events to be processed in the library table through the event producer;

[0064] When the event producer reads an asynchronous event to be processed, the event producer processes the read asynchronous event to be processed according to the target asynchronous processing strategy.

[0065] To achieve the above-mentioned purpose, the third aspect embodiment of the present application proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect.

[0066] To achieve the above-mentioned purpose, the fourth aspect of the present application proposes a computer-readable storage medium, in which computer-readable storage medium is stored computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.

[0067] To achieve the above-mentioned purpose, the fifth aspect of the present application proposes a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.

[0068] The business processing method, device, electronic device and storage medium of the distributed business system provided by the present application provide an asynchronous framework for business processing in the distributed core system, and process the non-customer business stage through the asynchronous framework, thereby shortening the execution time of business processing, reducing the error rate of business processing, and improving the execution efficiency of business processing, thereby enhancing the customer experience of the system. The asynchronous framework divides event participants into event producers and event consumers, and the event producer generates and publishes step events, and the event consumer processes the asynchronous events published by the event generator, thereby realizing the processing of asynchronous tasks in the non-customer business stage, with high processing efficiency and enhanced user experience. Event producers and event consumers select different asynchronous processing strategies according to different business scenarios, further improving processing efficiency and saving system resources. In addition, by processing abnormal interruptions through scheduled tasks, system stability is improved, waste of system resources is reduced, task execution efficiency is further improved, and system maintenance costs are reduced.

[0069] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0071] Figure 1 A flow chart of a business processing method of a distributed business system provided in an embodiment of the present application;

[0072] Figure 2 A flowchart of another business processing method of a distributed business system provided in an embodiment of the present application;

[0073] Figure 3A flowchart of a business processing method of another distributed business system provided in an embodiment of the present application;

[0074] Figure 4 A flowchart of a business processing method of another distributed business system provided in an embodiment of the present application;

[0075] Figure 5 A timing diagram of business processing by an asynchronous framework provided in an embodiment of the present application;

[0076] Figure 6 A flowchart of a business processing method of another distributed business system provided in an embodiment of the present application;

[0077] Figure 7 A timing diagram of a timed task provided in an embodiment of the present application;

[0078] Figure 8 A block diagram of a business processing device of a distributed business system provided in an embodiment of the present application;

[0079] Fig. 9 A block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0080] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0081] The following describes the service processing method, device and equipment of the distributed service system in the embodiments of the present application with reference to the accompanying drawings.

[0082] Figure 1 A flowchart of a business processing method of a distributed business system provided in an embodiment of the present application.

[0083] It should be noted that the executor of the business processing method of the distributed business system of the embodiment of the present application is the business processing device of the distributed business system of the embodiment of the present application. The business processing device of the distributed business system can be configured in an electronic device so that the electronic device can execute the business processing function of the distributed business system.

[0084] like Figure 1 As shown, the business processing method of the distributed business system includes the following steps:

[0085] Step 101, obtaining a business processing request of a target business, where the target business includes a customer business stage and a non-customer business stage; wherein the customer business stage refers to a business processing stage directly related to the customer business, and the non-customer business stage refers to a business processing stage not directly related to the customer business.

[0086] It can be understood that in order to improve the response speed of the system and enhance the customer experience, the original business is divided into two segments, customer business and non-customer business, so that in subsequent steps, the system returns a request response after the customer business is completed, and the non-customer business is processed through an asynchronous framework in subsequent steps without affecting the customer business.

[0087] Step 102, processing the tasks of the customer service stage of the target business to obtain a first processing result; and returning a response result of the business processing request based on the first processing result.

[0088] It can be understood that the distributed core business system processes the tasks of the customer service stage of the target business and obtains the first processing result; and returns the response result of the business processing request according to the first processing result. That is, after processing the tasks of the customer service stage, the processing result is immediately returned to the customer who issued the business processing request. For example, success can be returned after the customer service is completed.

[0089] Step 103, after returning the response result of the business processing request, the asynchronous task of the non-customer business phase of the target business is processed through the asynchronous framework, and the asynchronous framework processes the asynchronous task in an asynchronous event-driven manner.

[0090] The original technical framework of the distributed core business system is a synchronous processing framework. Now, on this basis, an asynchronous framework is added to the synchronous processing framework, and the asynchronous framework technology is used to implement the processing request of a business. After the customer business is completed, it can return success, and subsequent processing is executed asynchronously, which improves processing efficiency and improves customer experience.

[0091] The business processing method, device, electronic device and storage medium of the distributed business system provided in the present application provide an asynchronous framework for business processing in the distributed core system, process non-customer business stages through the asynchronous framework, shorten the execution time of business processing, reduce the error rate of business processing, improve the execution efficiency of business processing, and enhance the customer experience of the system.

[0092] The following is a detailed description of the asynchronous tasks of the non-customer business stage of the target business in step 103 processed by the asynchronous framework. The asynchronous framework of this embodiment divides the event participants that process asynchronous tasks into event generators and event consumers. The event producer generates and registers asynchronous events, and the event consumer consumes and processes asynchronous events. It should be noted that there can be many event producers. The asynchronous framework of this application is a general framework, and the event producer is not limited to a certain one. Exemplarily, when the account balance in the core business system of the bank changes, if the customer signs an account change contract, all transactions with the balance change are event producers, such as deposits, withdrawals, transfers, interest settlements, etc. are all event producers. There are also non-account notifications, such as customer contract notifications, card expiration advance notifications, etc., which are also event producers. Event consumers refer to the event listening threads and asynchronous timed tasks of the asynchronous framework.

[0093] Figure 2 A flowchart of another business processing method of a distributed business system provided in an embodiment of the present application.

[0094] like Figure 2 As shown, the business processing method of the distributed business system includes the following steps:

[0095] Step 201, for asynchronous tasks in the non-customer business phase of the target business, the event producer publishes and registers asynchronous events according to the asynchronous processing strategy; the asynchronous framework divides the event participants who process the asynchronous tasks into event producers and event consumers.

[0096] As an implementation method, the event producer publishes and registers asynchronous events according to the asynchronous processing strategy, such as Figure 3 As shown, the following steps are included:

[0097] Step 301 : In response to a request for processing an asynchronous task, the event producer sets asynchronous event information to be processed in the system global context of the distributed business system.

[0098] It can be understood that if the business processing involves asynchronous processing business scenarios, such as outbound accounting messages, SMS messages, routing information registration, asynchronous file processing, etc., the event producer sets the asynchronous event information to be processed in the system global context. The conditions for triggering the heterogeneous framework are that the transaction is successful and there is asynchronous event content in the context.

[0099] Step 302, the distributed business system checks whether there is asynchronous event information in the system global context; if there is asynchronous event information, the event producer sets the event context, registers the asynchronous event information in the library table, and commits the transaction.

[0100] It can be understood that after the customer service stage is processed, the system checks whether there is asynchronous event information in the global context. If there is asynchronous event information, the event producer sets the event context. After the asynchronous event context is set, the event information is registered in the library table and the transaction is committed. The committing transaction here means writing the event content to the database table to avoid service abnormalities and downtime that prevent subsequent processing from being completed.

[0101] Step 303, after the transaction is committed, the asynchronous event information is obtained from the event context through the event producer, and a target asynchronous processing strategy is selected from multiple asynchronous processing strategies according to the business scenario to which the asynchronous task belongs; and the asynchronous event corresponding to the asynchronous event information is processed according to the target asynchronous processing strategy.

[0102] In some embodiments, multiple asynchronous processing strategies include four asynchronous processing strategies, and the four asynchronous processing strategies are respectively the first asynchronous processing strategy to the fourth asynchronous processing strategy, wherein the first asynchronous processing strategy (referred to as strategy 1) is to register to the library table first and then perform asynchronous processing, the second asynchronous processing strategy (referred to as strategy 2) is to perform asynchronous processing first and register to the library table after the processing fails, the third asynchronous processing strategy (referred to as strategy 3) is to only register to the library table, and the fourth asynchronous processing strategy (referred to as strategy 4) is only asynchronous processing.

[0103] When the target asynchronous processing strategy is the first asynchronous processing strategy, the asynchronous event is first registered in the library table by the event producer, and then the asynchronous event is released.

[0104] When the target asynchronous processing strategy is the second asynchronous processing strategy, the asynchronous event is first published through the event producer, and is registered in the library table after the asynchronous event processing fails.

[0105] When the target asynchronous processing strategy is the third asynchronous processing strategy, the asynchronous event is directly registered in the library table through the event producer without publishing the asynchronous event, and the asynchronous event setting is subsequently completed by the scheduled task.

[0106] When the target asynchronous processing strategy is the fourth asynchronous processing strategy, the event producer only publishes the asynchronous event without registering the library table.

[0107] Therefore, the appropriate asynchronous processing strategy can be selected for processing according to the business scenario, which is decided by the developer. For example, for business scenarios with high consistency and real-time requirements, the first asynchronous processing strategy is used; for business scenarios with high consistency requirements but low real-time requirements, the third asynchronous processing strategy is used. For business scenarios with high real-time requirements and low consistency, the second asynchronous processing strategy is used. For business scenarios with low consistency and low real-time requirements, the fourth asynchronous processing strategy is used. Select the appropriate asynchronous processing strategy for processing according to different business scenarios. For example, the first asynchronous processing strategy is used for business scenarios where data calculation must be correct. For scenarios where sending messages does not matter if the message fails, the second asynchronous processing strategy is used to improve business processing efficiency.

[0108] Step 202: Process the asynchronous event through the event consumer, and update the processing status of the asynchronous event according to the asynchronous processing strategy.

[0109] As an implementation method, the event consumer processes asynchronous events and updates the processing status of asynchronous events according to the target asynchronous processing strategy, such as Figure 4 As shown, the following steps are included:

[0110] Step 401: After the event consumer monitors the asynchronous event published by the event producer, the asynchronous event information is obtained from the event context.

[0111] Step 402, the event consumer calls the corresponding business processing logic to process the business that needs to be processed by the asynchronous event to obtain a second processing result; and performs subsequent processing according to the second processing result and the target asynchronous processing strategy.

[0112] In some embodiments, the subsequent processing includes:

[0113] When the target asynchronous processing strategy is the first asynchronous processing strategy, the asynchronous event record state in the library table is modified through the event consumer;

[0114] When the target asynchronous processing strategy is the second asynchronous processing strategy, the event consumer is used to check whether the second processing result fails, and if it fails, the failed asynchronous event information is registered in the library table;

[0115] When the target asynchronous processing strategy is the first asynchronous processing strategy or the second asynchronous processing strategy, no processing is performed by the event consumer.

[0116] That is to say, if it is strategy 1, the event record status in the DB is modified; if it is strategy 2, the result is checked, and if the processing fails, the event record is registered in the DB and subsequently handled by a scheduled task; if it is strategy 3 or 4, no processing is done.

[0117] For example, the processing sequence of event producers and event consumers is as follows: Figure 5 As shown, the event producer generates an asynchronous event according to the content in the event context, and processes the asynchronous event according to the corresponding asynchronous processing strategy. Because it is processed within the system, the processing result of the asynchronous event is adjusted by the complex state of the event consumer.

[0118] In some embodiments, when an abnormal interruption occurs during the processing of an asynchronous event, a method for processing the asynchronous event through a scheduled task is as follows: Figure 6 As shown, including:

[0119] Step 501, in response to the timing task being triggered, the following steps are executed cyclically until there are no asynchronous events to be processed in the library table;

[0120] Step 502, read the asynchronous events to be processed in the library table through the event producer;

[0121] Step 503: When the event producer reads an asynchronous event to be processed, the event producer processes the asynchronous event to be processed according to the target asynchronous processing strategy.

[0122] It can be understood that during the asynchronous event processing, if the processing process is abnormally interrupted (for strategies 1, 2, and 3), subsequent processing will be performed through scheduled tasks. Scheduled task processing is used to handle unprocessed asynchronous event information. It is triggered by the configured timer and supports parallel processing. A scheduled trigger is an execution program that will trigger the execution of a task according to the execution cycle set by the user. For example, if it is set to execute every minute, the set task will be executed every one minute (the task is a program to complete a certain business processing). After the scheduled task is triggered, the trigger event producer reads the pending asynchronous events in the library table. If there are no unprocessed asynchronous events, the current scheduled task ends. If there are pending asynchronous events, it executes in a loop: the event producer publishes the read asynchronous events one by one according to the corresponding asynchronous processing strategy, and the event consumer processes the asynchronous events after the release. Exemplarily, the processing sequence of the scheduled task is as follows: Figure 7 shown.

[0123] It should also be noted that the generation and consumption of asynchronous events are respectively executed by event producers and event consumers obtaining threads from the asynchronous thread pool.

[0124] The business processing method of the distributed business system provided by the present application, the asynchronous framework divides event participants into event producers and event consumers, the event producer generates and publishes step events, and the event consumer processes the asynchronous events published by the event producer, so as to realize the processing of asynchronous tasks in the non-customer business stage, with high processing efficiency and enhanced user experience. Event producers and event consumers select different asynchronous processing strategies according to different business scenarios to further improve processing efficiency and save system resources. In addition, by processing abnormal interruptions through scheduled tasks, the system stability is improved, the waste of system resources is reduced, the efficiency of task execution is further improved, and the system maintenance cost is reduced.

[0125] In order to implement the above embodiments, the present application also proposes a service processing device for a distributed service system. Figure 8 A block diagram of a service processing device of a distributed service system provided in an embodiment of the present application. Figure 8 As shown, the service processing device of the distributed service system may include: a request acquisition module 801 , a first service processing module 802 , and a second service processing module 803 .

[0126] The request acquisition module 801 is used to acquire a business processing request of a target business, and the target business includes a customer business stage and a non-customer business stage; wherein the customer business stage refers to a business processing stage directly related to the customer business, and the non-customer business stage refers to a business processing stage not directly related to the customer business;

[0127] The first business processing module 802 is used to process the tasks of the customer business stage of the target business, obtain a first processing result, and return a response result of the business processing request based on the first processing result;

[0128] The second business processing module 803 is used to process asynchronous tasks of the non-customer business phase of the target business through an asynchronous framework after returning a response result of the business processing request. The asynchronous framework processes asynchronous tasks in an asynchronous event-driven manner.

[0129] Further, in a possible implementation of the embodiment of the present application, the asynchronous framework divides the event participants who process the asynchronous task into event generators and event consumers, and the second business processing module 803 is specifically used to:

[0130] For asynchronous tasks in the non-customer business phase of the target business, the event producer publishes and registers asynchronous events according to the asynchronous processing strategy;

[0131] Process asynchronous events through event consumers and update the processing status of asynchronous events according to the asynchronous processing strategy.

[0132] Further, in a possible implementation of the embodiment of the present application, when the second service processing module 803 publishes and registers an asynchronous event according to the asynchronous processing strategy through the event producer, it is used to:

[0133] In response to the processing request of the asynchronous task, the asynchronous event information to be processed is set in the system global context of the distributed business system through the event producer;

[0134] Check whether there is asynchronous event information in the system global context through the distributed business system; if there is asynchronous event information, the event producer sets the event context, registers the asynchronous event information in the library table, and commits the transaction;

[0135] After the transaction is committed, the asynchronous event information is obtained from the event context through the event producer, and a target asynchronous processing strategy is selected from multiple asynchronous processing strategies according to the business scenario to which the asynchronous task belongs; and the asynchronous event corresponding to the asynchronous event information is processed according to the target asynchronous processing strategy.

[0136] Further, in a possible implementation of the embodiment of the present application, the multiple asynchronous processing strategies include four asynchronous processing strategies, and the four asynchronous processing strategies are respectively the first asynchronous processing strategy to the fourth asynchronous processing strategy, wherein the first asynchronous processing strategy is to register to the library table first and then perform asynchronous processing, the second asynchronous processing strategy is to perform asynchronous processing first and register to the library table after the processing fails, the third asynchronous processing strategy is to only register to the library table, and the fourth asynchronous processing strategy is to only perform asynchronous processing;

[0137] When processing the asynchronous event corresponding to the asynchronous event information according to the target asynchronous processing strategy, the second service processing module 803 is used to:

[0138] When the target asynchronous processing strategy is the first asynchronous processing strategy, the asynchronous event is first registered in the library table through the event producer, and then the asynchronous event is released;

[0139] When the target asynchronous processing strategy is the second asynchronous processing strategy, the asynchronous event is first published through the event producer, and is registered in the library table after the asynchronous event processing fails;

[0140] When the target asynchronous processing strategy is the third asynchronous processing strategy, the asynchronous event is directly registered in the library table through the event producer without publishing the asynchronous event. The asynchronous event is subsequently completed by the scheduled task.

[0141] When the target asynchronous processing strategy is the fourth asynchronous processing strategy, the event producer only publishes the asynchronous event without registering the library table.

[0142] Further, in a possible implementation of the embodiment of the present application, when the second business processing module 803 processes the asynchronous event through the event consumer and updates the processing status of the asynchronous event according to the asynchronous processing strategy, it is used to:

[0143] After the event consumer monitors the asynchronous event published by the event producer, it obtains the asynchronous event information from the event context;

[0144] The event consumer calls the corresponding business processing logic to process the business that needs to be processed by the asynchronous event to obtain a second processing result; and performs subsequent processing according to the second processing result and the target asynchronous processing strategy.

[0145] Furthermore, in a possible implementation of the embodiment of the present application, the second service processing module 803 is used in subsequent processing to:

[0146] When the target asynchronous processing strategy is the first asynchronous processing strategy, the asynchronous event record state in the library table is modified through the event consumer;

[0147] When the target asynchronous processing strategy is the second asynchronous processing strategy, the event consumer is used to check whether the second processing result fails, and if it fails, the failed asynchronous event information is registered in the library table;

[0148] When the target asynchronous processing strategy is the first asynchronous processing strategy or the second asynchronous processing strategy, no processing is performed by the event consumer.

[0149] Furthermore, in a possible implementation of the embodiment of the present application, the second service processing module 803 is further configured to:

[0150] In response to the timing task being triggered, the following steps are executed cyclically until there are no pending asynchronous events in the library table;

[0151] Read the asynchronous events to be processed in the library table through the event producer;

[0152] When the event producer reads an asynchronous event to be processed, the event producer processes the asynchronous event to be processed according to the target asynchronous processing strategy.

[0153] It should be noted that the above explanation of the embodiment of the service processing method of the distributed service system is also applicable to the service processing device of the distributed service system of this embodiment, and will not be repeated here.

[0154] In order to implement the above embodiment, the present application also proposes an electronic device. Fig. 9 , Fig. 9 is a block diagram of an electronic device provided in an embodiment of the present application. Fig. 9As shown, the electronic device 900 includes: a processor 901, and a memory 902 communicatively connected to the processor 901; the memory 902 stores computer-executable instructions; the processor 901 executes the computer-executable instructions stored in the memory to implement the method provided in the aforementioned embodiment.

[0155] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.

[0156] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which implements the methods provided by the above embodiments when executed by a processor.

[0157] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.

[0158] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.

[0159] The present application is expected to provide an implementation scheme for users to selectively block the use or access of personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.

[0160] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0161] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0162] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0163] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0164] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0165] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0166] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0167] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A business processing method of a distributed business system, characterized in that: The following steps are involved: Obtaining a business processing request for a target business, wherein the target business includes a customer business stage and a non-customer business stage; wherein the customer business stage refers to a business processing stage directly related to the customer business, and the non-customer business stage refers to a business processing stage not directly related to the customer business; Processing the task of the customer service stage of the target business to obtain a first processing result; and returning a response result of the business processing request based on the first processing result; After returning the response result of the business processing request, the asynchronous task of the non-customer business phase of the target business is processed by the asynchronous framework, and the asynchronous framework processes the asynchronous task in an asynchronous event-driven manner.

2. The method according to claim 1, characterized in that The asynchronous framework divides the event participants who process the asynchronous task into event generators and event consumers. The asynchronous task of the non-customer business phase of the target business processed by the asynchronous framework includes: For the asynchronous tasks of the non-customer business phase of the target business, the event producer publishes and registers asynchronous events according to the asynchronous processing strategy; The asynchronous event is processed by the event consumer, and the processing status of the asynchronous event is updated according to the asynchronous processing strategy.

3. The method according to claim 2, characterized in that The publishing and registering of asynchronous events according to the asynchronous processing strategy by the event producer includes: In response to the processing request of the asynchronous task, setting the asynchronous event information to be processed in the system global context of the distributed business system through the event producer; Checking whether there is asynchronous event information in the system global context through the distributed business system; if there is asynchronous event information, the event producer sets the event context, registers the asynchronous event information in the library table, and commits the transaction; After the transaction is submitted, the asynchronous event information is obtained from the event context through the event producer, and a target asynchronous processing strategy is selected from multiple asynchronous processing strategies according to the business scenario to which the asynchronous task belongs; and the asynchronous event corresponding to the asynchronous event information is processed according to the target asynchronous processing strategy.

4. The method according to claim 3, characterized in that The multiple asynchronous processing strategies include four asynchronous processing strategies, and the four asynchronous processing strategies are respectively the first asynchronous processing strategy to the fourth asynchronous processing strategy, wherein the first asynchronous processing strategy is to register to the library table first and then perform asynchronous processing, the second asynchronous processing strategy is to perform asynchronous processing first and register to the library table after the processing fails, the third asynchronous processing strategy is to only register to the library table, and the fourth asynchronous processing strategy is to only perform asynchronous processing; The step of processing the asynchronous event corresponding to the asynchronous event information according to the target asynchronous processing strategy includes: When the target asynchronous processing strategy is the first asynchronous processing strategy, the asynchronous event is first registered in a library table by the event producer, and then the asynchronous event is published; When the target asynchronous processing strategy is the second asynchronous processing strategy, the asynchronous event is first published by the event producer, and is registered in the library table after the asynchronous event processing fails; When the target asynchronous processing strategy is the third asynchronous processing strategy, the asynchronous event is directly registered in the library table by the event producer without publishing the asynchronous event, and the asynchronous event is subsequently completed by a scheduled task; When the target asynchronous processing strategy is the fourth asynchronous processing strategy, the event producer only publishes the asynchronous event without registering the library table.

5. The method according to claim 4, characterized in that The processing of the asynchronous event by the event consumer and updating the processing status of the asynchronous event according to the asynchronous processing strategy includes: After the event consumer monitors the asynchronous event published by the event producer, the asynchronous event information is obtained from the event context; The event consumer calls the corresponding business processing logic to process the business that needs to be processed by the asynchronous event to obtain a second processing result; and performs subsequent processing according to the second processing result and the target asynchronous processing strategy.

6. The method according to claim 4, characterized in that The subsequent processing includes: When the target asynchronous processing strategy is the first asynchronous processing strategy, modifying the asynchronous event record state in the library table through the event consumer; When the target asynchronous processing strategy is the second asynchronous processing strategy, checking whether the second processing result fails through the event consumer, and registering the failed asynchronous event information to the library table when it fails; When the target asynchronous processing strategy is the first asynchronous processing strategy or the second asynchronous processing strategy, no processing is performed by the event consumer.

7. The method according to claim 6, characterized in that The method further comprises: In response to the timing task being triggered, the following steps are executed cyclically until there are no asynchronous events to be processed in the library table; Reading the asynchronous events to be processed in the library table through the event producer; When the event producer reads an asynchronous event to be processed, the event producer processes the read asynchronous event to be processed according to the target asynchronous processing strategy.

8. A business processing device for a distributed business system, characterized in that: include: A request acquisition module, used to acquire a business processing request of a target business, wherein the target business includes a customer business stage and a non-customer business stage; wherein the customer business stage refers to a business processing stage directly related to the customer business, and the non-customer business stage refers to a business processing stage not directly related to the customer business; A first business processing module, configured to process the tasks of the customer business phase of the target business, obtain a first processing result; and return a response result of the business processing request based on the first processing result; The second business processing module is used to process the asynchronous task of the non-customer business phase of the target business through an asynchronous framework after returning the response result of the business processing request, and the asynchronous framework processes the asynchronous task in an asynchronous event-driven manner.

9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.

Citation Information

Patent Citations

  • Distributed transaction solution under micro-service architecture

    CN106993023A

  • An asynchronous message reliable delivery and processing method and device

    CN113094362A

  • Business processing method and device, electronic equipment and storage medium

    CN118212048A

  • Method for ensuring fund account data consistency in cross-machine-room scene

    CN118568104A

  • Policy-based distributed transactional processing in a distributed system

    US20200226011A1