Search

CN-122019210-A - Method, business system, device and storage medium for processing business event

CN122019210ACN 122019210 ACN122019210 ACN 122019210ACN-122019210-A

Abstract

The application discloses a method, a service system, a device and a storage medium for processing service events, which are used for realizing loose coupling among multiple systems. The method for processing the business event comprises the steps of asynchronously consuming financial event information in a preset information queue, preprocessing the financial event information to obtain a processing result, routing a financial context object to a corresponding scene converter according to a business event type so that the scene converter processes the financial context object to obtain an enhanced context object, routing the enhanced context object to a corresponding adaptation converter according to business data field characteristics so that the adaptation converter processes the enhanced context object to obtain a financial registration request instruction, responding to the financial registration request instruction to generate an accounting entry document, and calling a corresponding external system interface according to the accounting entry document so that an external system responds to the financial event information.

Inventors

  • LIU WEI
  • Lv Qingyan
  • WU LEI

Assignees

  • 上海信小飞数字科技有限公司

Dates

Publication Date
20260512
Application Date
20260128

Claims (10)

  1. 1. A method of processing a business event, characterized by being applied to a business system, comprising: asynchronously consuming financial event messages in a preset message queue; Preprocessing the financial event message to obtain a processing result, wherein the processing result comprises a business event type and a financial context object; According to the service event type, routing the financial context object to a corresponding scene converter so that the scene converter processes the financial context object to obtain an enhanced context object, wherein the enhanced context object comprises a service module identifier and service data field characteristics; According to the characteristics of the service data field, the enhanced context object is routed to a corresponding adaptation converter, so that the adaptation converter processes the enhanced context object to obtain a financial registration request instruction; responding to the financial registration request instruction to generate an accounting entry document; And calling a corresponding external system interface according to the accounting entry document so that the external system responds to the financial event message.
  2. 2. The method of claim 1, wherein preprocessing the financial event message to obtain a processing result comprises: Performing deserialization processing on the financial event message to obtain preliminary service data, wherein the preliminary service data comprises a service event type; And carrying out integrity check on the preliminary service data, and if the integrity check is passed, constructing a financial context object according to the preliminary service data.
  3. 3. The method of claim 2, further comprising, after said performing an integrity check on said preliminary service data: If the integrity check is not passed, executing the financial event message in the message queue preset by asynchronous consumption and performing deserialization processing on the financial event message again; And performing second integrity check, if the second integrity check is not passed, transferring the corresponding financial event message to a dead mail queue, and recording an error log.
  4. 4. The method of claim 1, wherein said routing the financial context object to a corresponding context switch according to the business event type comprises: based on a mapping relation between a preconfigured service event type and a scene converter identifier, performing query according to the service event type to obtain a target scene converter identifier; Acquiring a corresponding scene converter according to the target scene converter identifier; The financial context object is routed to the corresponding scene converter.
  5. 5. The method of claim 1, wherein said routing the enhanced context object to a corresponding adaptation converter according to the traffic data field characteristics comprises: acquiring a corresponding service scene code through a decision tree algorithm according to the service data field characteristics; Inquiring a mapping relation between a pre-configured scene code and an adaptive converter identifier according to the service scene code to obtain a target adaptive converter identifier; acquiring a corresponding adaptive converter according to the target adaptive converter identifier through an adaptive converter factory class; The enhanced context object is routed to the corresponding adaptation converter.
  6. 6. The method of claim 5, wherein the obtaining the corresponding service context code by a decision tree algorithm based on the service data field characteristics comprises: Extracting features of at least one dimension from the business data field features, the dimension including event type, sponsor source, payment channel, and/or repayment detail structure; Based on a pre-constructed decision tree model, carrying out multistage condition judgment according to the characteristics of at least one dimension to obtain a judgment result; And generating a service scene code according to the judging result.
  7. 7. The method of claim 1, wherein the invoking the corresponding external system interface according to the accounting entry document comprises: Acquiring a corresponding instruction processor through an instruction distribution factory class according to the type of the accounting entry document; generating a request for calling a corresponding external system interface according to the accounting entry document by the instruction processor; And responding to the request according to a preset retry strategy until the corresponding external system interface is successfully invoked.
  8. 8. A business system, comprising: The asynchronous consumption unit is used for asynchronously consuming financial event messages in a preset message queue; The preprocessing unit is used for preprocessing the financial event message to obtain a processing result, wherein the processing result comprises a business event type and a financial context object; The first routing unit is used for routing the financial context object to a corresponding scene converter according to the service event type so that the scene converter can process the financial context object to obtain an enhanced context object, and the enhanced context object comprises a service module identifier and service data field characteristics; a second routing unit, configured to route, according to the service data field feature, the enhanced context object to a corresponding adaptation converter, so that the adaptation converter processes the enhanced context object to obtain a financial registration request instruction; the response unit is used for responding to the financial registration request instruction and generating an accounting entry document; and the calling unit is used for calling a corresponding external system interface according to the accounting entry document so that the external system responds to the financial event message.
  9. 9. An apparatus for processing a business event, comprising: a processor, a memory, an input-output unit, and a bus; The processor is connected with the memory, the input/output unit and the bus; the memory holds a program which the processor invokes to perform the method of handling traffic events according to any of claims 1 to 7.
  10. 10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a program which, when executed on a computer, performs the method of handling a business event according to any of claims 1 to 7.

Description

Method, business system, device and storage medium for processing business event Technical Field The embodiment of the application relates to the technical field of financial information processing, in particular to a method, a system, electronic equipment and a storage medium for processing business events. Background In conventional financial management systems, business systems interact with financial systems typically in a tightly integrated architecture model. Specifically, when the business system generates a transaction requiring financial recording, an application program interface exposed by the financial system is directly called to trigger a financial processing flow, namely, the business system immediately calls a service interface of the financial system to initiate a financial processing request in a remote procedure call or hypertext transfer protocol request mode, and after the financial system finishes data verification, credential generation and accounting update, the processing result is synchronously returned to the business system, so that closed-loop processing of financial events is realized. However, in the above method, the failure of a single system may be rapidly spread by directly calling the chain, so that the reliability of the entire traffic processing link is limited by the weakest link among them. When the financial system is interrupted or delayed in response due to upgrading, faults or performance pressure, all relevant operation flows of the business system depending on interfaces are blocked or failed, communication links of the two parties are interrupted, a large-scale business function is not available, and business continuity cannot be guaranteed. Disclosure of Invention The application discloses a method, a service system, a device and a storage medium for processing service events, which are used for realizing loose coupling among multiple systems. The first aspect of the present application discloses a method for processing a service event, which is applied to a service system and comprises: asynchronously consuming financial event messages in a preset message queue; Preprocessing the financial event message to obtain a processing result, wherein the processing result comprises a business event type and a financial context object; According to the service event type, routing the financial context object to a corresponding scene converter so that the scene converter processes the financial context object to obtain an enhanced context object, wherein the enhanced context object comprises a service module identifier and service data field characteristics; According to the characteristics of the service data field, the enhanced context object is routed to a corresponding adaptation converter, so that the adaptation converter processes the enhanced context object to obtain a financial registration request instruction; responding to the financial registration request instruction to generate an accounting entry document; And calling a corresponding external system interface according to the accounting entry document so that the external system responds to the financial event message. Optionally, the preprocessing the financial event message to obtain a processing result includes: Performing deserialization processing on the financial event message to obtain preliminary service data, wherein the preliminary service data comprises a service event type; And carrying out integrity check on the preliminary service data, and if the integrity check is passed, constructing a financial context object according to the preliminary service data. Optionally, after the integrity check of the preliminary service data, the method further includes: If the integrity check is not passed, executing the financial event message in the message queue preset by asynchronous consumption and performing deserialization processing on the financial event message again; And performing second integrity check, if the second integrity check is not passed, transferring the corresponding financial event message to a dead mail queue, and recording an error log. Optionally, the routing the financial context object to the corresponding scene converter according to the service event type includes: based on a mapping relation between a preconfigured service event type and a scene converter identifier, performing query according to the service event type to obtain a target scene converter identifier; Acquiring a corresponding scene converter according to the target scene converter identifier; The financial context object is routed to the corresponding scene converter. Optionally, the routing the enhanced context object to the corresponding adaptation converter according to the service data field characteristics includes: acquiring a corresponding service scene code through a decision tree algorithm according to the service data field characteristics; Inquiring a mapping relation between a pre-configured scene co