Message event processing method, component, computer device and storage medium

By receiving messages from upstream business systems and processing according to the pre -configured conversion rules, it is processed to generate new news that conforms to the logic of downstream business systems, solve the problem of high cost and low efficiency in the connection of upstream message events in traditional technologies, and simplified , Fast and stable message incident docking.

CN115442203BActive Publication Date: 2025-01-24SHANGHAI SHUHE INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210997758.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-19
Publication Date
2025-01-24
Estimated Expiration
2042-08-19

AI Technical Summary

Technical Problem

In traditional technology, if the downstream business system wants to consume messages sent by the upstream business system, it needs to write code to connect with the message events of the upstream business system, resulting in high cost and low efficiency of new access message events.

Method used

Provide a message event processing method. By receiving messages sent by the upstream business system, determine the target message event, obtain the pre -configured conversion rules configuration information, process the message, generate new messages that conform to the logic of the downstream business system business processing, and and also generate the logic of the downstream business system business processing logic. Return to business processing logic.

Benefits of technology

This method does not require interrupting downstream services, avoids the need to modify business processing logic codes and restart the system for different message events, simplifies the process of connecting upstream message events, reduces workload and improves efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115442203B_ABST
    Figure CN115442203B_ABST
Patent Text Reader

Abstract

The present application relates to a message event processing method, component, computer device and storage medium. The method comprises: receiving a message sent by an upstream business system; determining a target message event corresponding to the message; obtaining conversion rule configuration information pre-configured for the target message event; processing the message according to the conversion rule configuration information to obtain a new message that conforms to the business processing logic of the downstream business system; calling back the new message to the business processing logic so that the downstream business system performs business processing according to the new message during the execution of the business processing logic. The use of this method can improve the efficiency of message events docking with the upstream business system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer software technology, and in particular to a message event processing method, component, computer device and storage medium. Background Art

[0002] With the development of computer software technology, in the development of background programs, there are many business scenarios that require the use of message middleware, such as Rabbit MQ (Rabbit Message Queue) message middleware, etc. The use of message middleware can realize asynchronous service calls, improve system response speed, and decouple upstream and downstream business systems.

[0003] However, in traditional technology, if a downstream business system wants to consume messages sent by an upstream business system, it must first write code in the program to connect with a message event of the upstream business system. Different codes for parsing the message body need to be written for different message events. Moreover, after the code or configuration file is written, the downstream business system program needs to be restarted to make the corresponding parsing function take effect. Therefore, when a new message event needs to be accessed, the cost of connecting to the upstream business system message event is high and the efficiency is low. Summary of the invention

[0004] Based on this, it is necessary to provide a message event processing method, component, computer device and storage medium that can improve the efficiency of connecting to upstream message events in response to the above technical problems.

[0005] A message event processing method, the method comprising:

[0006] Receive messages sent by upstream business systems;

[0007] Determine the target message event corresponding to the message;

[0008] Obtain conversion rule configuration information pre-configured for the target message event;

[0009] Process the message according to the conversion rule configuration information to obtain a new message that conforms to the business processing logic of the downstream business system;

[0010] The new message is called back to the business processing logic so that the downstream business system performs business processing according to the new message during the execution of the business processing logic.

[0011] In one embodiment, before processing the message according to the conversion rule configuration information, the method further includes:

[0012] Get the validation rule configuration information of the target message event;

[0013] Determine whether a specified field in the message meets the validation condition set in the validation rule configuration information according to the validation rule configuration information;

[0014] In response to the specified field meeting the verification condition, a step of processing the message according to the conversion rule configuration information is executed.

[0015] In one embodiment, the message is processed according to the conversion rule configuration information to obtain a new message that complies with the business processing logic of the downstream business system, including:

[0016] Determine a target field from the message according to the conversion rule configuration information;

[0017] Extract target parameters from target field;

[0018] Obtain business specification information and business attribute information of downstream business systems;

[0019] Convert the target parameters into an expression that complies with the business specifications of the downstream business system according to the business specification information;

[0020] The converted target parameters and business attribute information are reorganized and processed to generate new messages.

[0021] In one embodiment, the method further comprises:

[0022] Obtain a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list;

[0023] The message switches corresponding to each message event are bound to their respective designated queues according to the binding rule configuration information.

[0024] In one embodiment, obtaining a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list includes:

[0025] Receive the real-time message event list reported by the downstream business system, and obtain the binding rule configuration information corresponding to each message event in the real-time message event list from the event configuration terminal according to the real-time message event list.

[0026] In one embodiment, obtaining a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list includes:

[0027] Based on the scheduled task, the real-time message event list and the binding rule configuration information corresponding to each message event in the real-time message event list are periodically pulled from the event configuration terminal.

[0028] In one embodiment, the method further comprises:

[0029] Get the cache message event list from the cache;

[0030] Determine the invalid message event from the cache message event list;

[0031] In response to the message switch of the invalid message event not being associated with the valid message event, the message switch of the invalid message event is unbound from the corresponding designated queue.

[0032] In one embodiment, the method further comprises:

[0033] The message switch in response to the invalid message event also associates the valid message event and determines the type of the message switch of the invalid message event;

[0034] In response to the type being a topic type, unbinding the message switch of the invalid message event from its corresponding designated queue;

[0035] In response to the type being a broadcast type, a binding relationship between the message switch of the invalidation message event and its corresponding designated queue is maintained.

[0036] A message event processing component, which is applied to a downstream business system, includes:

[0037] Message receiving module, used to receive messages sent by upstream business systems;

[0038] The message conversion module is used to determine the target message event corresponding to the message, obtain the conversion rule configuration information pre-configured for the target message event, and process the message according to the conversion rule configuration information to obtain a new message that conforms to the business processing logic of the downstream business system;

[0039] The callback business module is used to call back the new message to the business processing logic so that the downstream business system performs business processing according to the new message during the execution of the business processing logic.

[0040] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned message event processing methods when executing the computer program.

[0041] A computer-readable storage medium stores a computer program, which implements the steps of any one of the above-mentioned message event processing methods when executed by a processor.

[0042] The above-mentioned message event processing method, component, computer device and storage medium, after receiving a message from the upstream, first determine the message event corresponding to the message, and process the message according to the conversion rule configured by the message event corresponding to the message, to obtain a new message that conforms to the downstream business processing logic, and then call back the new message to the downstream business processing logic, and notify the downstream business system to perform subsequent business processing according to the new message and the parameters it carries. When using this method, when docking with upstream message events, there is no need to interrupt downstream business, modify business processing logic code for different message events, or restart the system after modifying hard code. Messages from different message events are processed accordingly according to the conversion rule configuration information, and subsequent business processing is completed by calling back the processed new message. Different message events released by the upstream business system can be docked simply, quickly and stably, reducing the workload of message event docking and improving docking efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 An application environment diagram of a message event processing method in an embodiment;

[0044] Figure 2 A schematic diagram of a flow chart of a message event processing method in one embodiment;

[0045] Figure 3 It is a flowchart of a message event processing method in an application example;

[0046] Figure 4 A structural block diagram of a message event processing component in one embodiment;

[0047] Figure 5 It is a timing diagram of the interaction between the modules of the message event processing component in an application instance;

[0048] Figure 6 It is a timing diagram of the interaction between the modules of the message event processing component in another application example;

[0049] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0051] In one embodiment, the message event processing method provided by the present application can be applied to Figure 1In the application environment shown. Among them, the first server 102 can communicate with the second server 104 through the network. The first server 102 refers to the server or server cluster of the upstream business system, the second server 104 refers to the server or server cluster of the downstream business system, the message event processing component 106 can be loaded on any one or more second servers 104, and can also be loaded on other servers independent of the second server 106. The terminal 108 is an event configuration terminal, which can communicate with the second server 104 loaded with the message event processing component 106 through the network. Among them, the terminal can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server can be implemented with an independent server or a server cluster composed of multiple servers.

[0052] Specifically, the second server 104 receives the message sent by the first server 102 of the upstream business system through the loaded message event processing component 106, determines the target message event corresponding to the message, obtains the conversion rule configuration information pre-configured for the target message event based on the terminal 108, processes the message according to the conversion rule configuration information, obtains a new message that conforms to the business processing logic of the downstream business system, and calls the new message back to the business processing logic, so that the downstream business system performs business processing according to the new message during the execution of the business processing logic.

[0053] In one embodiment, if Figure 2 As shown, a message event processing method is provided, which is applied to Figure 1 Taking the server loaded with the message event processing component as an example, the following steps may be specifically included:

[0054] Step S202: Receive a message sent by an upstream business system.

[0055] The upstream business system refers to the message production system, and the downstream business system refers to the message consumption system. Specifically, the upstream business system generates messages and sends the messages to the message queue of the downstream event management component based on the upstream server, and the event management component monitors the messages sent to the message queue in real time.

[0056] Step S204: Determine the target message event corresponding to the message.

[0057] The target message event refers to the message event to which the message belongs. The downstream business system can subscribe to at least one message event. The user can pre-configure relevant information for each message event to be subscribed in the event configuration terminal. The configurable information includes but is not limited to at least one of the message event number, message switch, designated queue, binding relationship between the message switch and the designated queue, binding rules, verification rules, conversion rules, etc.

[0058] Specifically, after receiving a message, the event management component obtains the metadata of the message, and can obtain the pre-configured configuration information of each currently subscribed message event from the cache or database, compares the metadata of the message and the configuration information of each message event, determines which message event the message belongs to from multiple message events, and uses the determined message event as the target message event.

[0059] Step S206: Acquire conversion rule configuration information pre-configured for the target message event.

[0060] The conversion rule configuration information refers to information for indicating the conversion rule of the message of the target message event into a new message. The user can configure the conversion rule for the target message event based on the configuration interface of the event configuration terminal.

[0061] Specifically, the message event processing component can pull the configured conversion rule configuration information from the event configuration terminal in real time or periodically and store it in the cache. After determining the target message event, the conversion rule configuration information corresponding to the target message event can be queried in the cache according to the number of the target message event.

[0062] Exemplarily, the conversion rules may include at least one of: key field screening rules, parameter format conversion rules, attribute field adding rules, and reorganization processing rules. Among them, the key field screening rules are used to indicate the selection of target fields that conform to the business processing logic of the downstream business system from the message body; the parameter format conversion rules are used to indicate the conversion of the parameters in the target field into a form that conforms to the downstream business specifications; the attribute field adding rules are used to indicate the use of the unique attributes of the downstream business system as newly added fields; the reorganization processing rules are used to indicate the reorganization and processing of the selected target fields and the newly added fields.

[0063] Step S208: Process the message according to the conversion rule configuration information to obtain a new message that complies with the business processing logic of the downstream business system.

[0064] Specifically, the event management component can process the received messages according to the conversion rule configuration information to generate new messages that conform to the business processing logic of its host downstream business system. Different messages from different message events can be converted according to different conversion rules to generate new messages that conform to the business processing logic of the downstream business system. Therefore, when it is necessary to subscribe to a new message event or the upstream business system modifies the message event, there is no need to interrupt the downstream business, nor to modify the message parsing code in the downstream business system, and there is no need to restart the system after modifying the hard code. It is only necessary to configure the corresponding conversion rules for different message events.

[0065] In one of the embodiments, a message is processed according to conversion rule configuration information to obtain a new message that conforms to the business processing logic of a downstream server, including: determining a target field from the message according to the conversion rule configuration information; extracting a target parameter from the target field; obtaining business specification information and business attribute information of a downstream business system; converting the target parameter into an expression that conforms to the business specification of the downstream business system according to the business specification information; and reorganizing and processing the converted target parameter and business attribute information to generate a new message.

[0066] In this embodiment, the business specification information refers to the specification requirements of the expression form defined by the downstream business system, and the business attribute information refers to the unique attributes configured by different downstream business systems for differentiated management. Exemplarily, the business specification information may include information such as unit specifications, language specifications, expression specifications, and definition specifications. The business attribute information may include information such as business person in charge, business type, business description, and business remarks.

[0067] In this embodiment, by acquiring the business specification information and business attribute information of the downstream business system, the message is converted in terms of both form and content, thereby further improving the matching degree between the generated new message and the business processing logic of the downstream business system.

[0068] Step S210: Calling back the new message to the business processing logic, so that the downstream business system performs business processing according to the new message during the execution of the business processing logic.

[0069] Specifically, the event management component executes the callback method and transmits the new message to the business processing logic of the downstream business system in a callback manner. The downstream business system continues to perform subsequent business processing according to the new message and its related parameters during the execution of the business processing logic.

[0070] The above-mentioned message event processing method, after receiving a message from the upstream, first determines the message event corresponding to the message, and processes the message according to the conversion rules configured for the message event corresponding to the message, to obtain a new message that conforms to the downstream business processing logic, and then calls back the new message to the downstream business processing logic, notifying the downstream business system to perform subsequent business processing according to the new message and the parameters it carries. When using this method, when docking with upstream message events, there is no need to interrupt downstream business, modify business processing logic code for different message events, or restart the system after modifying hard code. Messages from different message events are processed accordingly according to the conversion rule configuration information, and subsequent business processing is completed by calling back the processed new message. Different message events released by the upstream business system can be docked simply, quickly, and stably, reducing the workload of message event docking and improving docking efficiency.

[0071] In one of the embodiments, before processing the message according to the conversion rule configuration information, it also includes: obtaining the verification rule configuration information of the target message event; judging whether the specified field in the message meets the verification condition set in the verification rule configuration information according to the verification rule configuration information; in response to the specified field meeting the verification condition, executing the step of processing the message according to the conversion rule configuration information.

[0072] In this embodiment, the user can also configure the validation rules for the target message event based on the visual configuration interface in the event configuration terminal, and generate the validation rule configuration information. The downstream server can verify the received message according to the validation rule configuration information to determine whether the message meets the processing conditions. If the specified field of the message meets the validation conditions set in the validation rule configuration information, the message can be processed according to the conversion rule configuration information. Furthermore, if the specified field of the message does not meet the validation conditions set in the validation rule configuration information, the message can be discarded, that is, the subsequent processing of the message is terminated, and the downstream business system will not respond to the message accordingly.

[0073] Exemplarily, the verification rule may include at least one verification condition, and different verification conditions or different combinations of verification conditions may constitute different verification rules. For example, the verification rule may be configured to simultaneously satisfy the following verification conditions: 1. The status field is successful; 2. The UID field is not empty; 3. The loan amount field is greater than a preset value.

[0074] This embodiment, by obtaining pre-configured validation rule configuration information, can filter and remove unnecessary messages for the downstream business system before the downstream business system executes the business processing logic, thereby alleviating the business processing complexity of the downstream business system and reducing workload and resource consumption.

[0075] In one embodiment, the method further includes: obtaining a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list; and binding the message switch corresponding to each message event with the respective designated queue according to the binding rule configuration information. The binding rule configuration information includes the message switch corresponding to each message event and the binding relationship between the message switch and the designated queue.

[0076] In this embodiment, the user can also configure binding rules for each message event that he wants to subscribe to in the event configuration terminal, wherein the binding rule configuration information includes: the message switch corresponding to the message event, the specified queue, the binding relationship between the specified queue and the message switch, etc. According to the pre-configured binding rules, the message event processing component can automatically, quickly, and batch bind the message queue to the message switch corresponding to each message event, without the need to manually write a binding configuration file, thereby improving the efficiency of docking upstream message events.

[0077] In one of the embodiments, obtaining a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list includes: receiving a real-time message event list reported by a downstream business system, and obtaining binding rule configuration information corresponding to each message event in the real-time message event list from an event configuration terminal according to the real-time message event list.

[0078] In this embodiment, the downstream business system, as the host system of the message event processing component, can actively inform the message event processing component of the event numbers of each message event it is currently subscribing to in the form of a list, so that the message event processing component can retrieve the binding rule configuration information corresponding to each message event from the event configuration terminal according to the event number of each message event.

[0079] In one of the embodiments, obtaining a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list includes: periodically pulling the real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list from an event configuration terminal based on a scheduled task.

[0080] In this embodiment, by setting a scheduled task, at a certain time interval, the event configuration terminal is actively queried to see if there are any newly configured message events, the user dynamics of the event configuration terminal is monitored in real time, and the real-time message event list is obtained in time, thereby improving the binding efficiency and realizing dynamic binding.

[0081] In one of the embodiments, the method further includes: obtaining a cached message event list from the cache; determining an invalid message event from the cached message event list; and in response to the message switch of the invalid message event not being associated with a valid message event, unbinding the message switch of the invalid message event from its corresponding designated queue.

[0082] In this embodiment, each time after obtaining a message event list and performing dynamic binding, the message event list that has completed dynamic binding can be stored in the cache. After obtaining the real-time message event list, the message event list stored last time can be obtained from the cache as the cache message event list, and the numbers of each message event in the real-time message event list are compared with the numbers of each message event in the cache message event list, and the message events that exist in the cache message event list but do not exist in the real-time message event list are determined as invalid message events. Further, it can be determined whether the message switch corresponding to the invalid message event is still associated with other valid message events. If not, the message switch corresponding to the invalid message event can be directly unbound from its corresponding designated queue, thereby realizing rapid unbinding of the upstream and downstream, and dynamic unbinding can be realized without stopping the downstream application or restarting the program.

[0083] In one of the embodiments, the method further includes: in response to the message switch of the invalid message event also associating the valid message event, determining the type of the message switch of the invalid message event; in response to the type being a topic type, unbinding the message switch of the invalid message event from its corresponding designated queue; in response to the type being a broadcast type, maintaining the binding relationship between the message switch corresponding to the invalid message event and its corresponding designated queue.

[0084] In this embodiment, if the message switch of the invalid message event is also associated with other message events, and the associated other message events are valid message events, at this time, the type of the message switch can be judged to achieve accurate unbinding. For a message switch of type Topic, it can be directly unbound. This type of message switch and the specified queue can be bound by different routing keys. Therefore, the unbinding will not affect the normal progress of other message events. For a message switch of type Fanout, the same message switch will be routed to the same queue. The unbinding may affect the normal progress of other valid message events. Therefore, the unbinding operation may not be performed. By determining the invalid message event and distinguishing the type of the message switch for dynamic and timely unbinding, the queue idleness can be reduced and the queue utilization rate can be improved. Moreover, different operations can be performed for different message switches, which improves the flexibility of upstream and downstream docking.

[0085] Next, the message event processing method involved in this application is further described in detail with reference to an application example. Figure 3 As shown, Figure 3 A schematic diagram of a process flow of a message event processing method in an application example is shown, which may specifically include the following steps:

[0086] S31: Start the scheduled task;

[0087] S32: Determine whether the downstream business system provides a real-time message event list; if so, proceed to step S34; if not, proceed to step S33;

[0088] S33: Pull the real-time message event list from the event management terminal;

[0089] S34: Acquire configuration information of each message event according to the real-time message event list; wherein the configuration information may include: binding rule configuration information, verification rule configuration information and conversion rule configuration information;

[0090] S35: storing the real-time message event list and configuration information into a cache;

[0091] S36: Dynamically bind the message switch according to the binding rule configuration information;

[0092] S37: receiving a message sent by an upstream business system;

[0093] S38: querying the corresponding message event and its verification rule configuration information and conversion rule configuration information from the cache according to the metadata of the message;

[0094] S39: Execute message verification and conversion processing to generate a new message;

[0095] S310: Notify the downstream business system to execute business processing logic according to the new message.

[0096] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0097] In one embodiment, if Figure 4 As shown, a message event processing component is provided, including: a message receiving module 402, a message conversion module 404 and a callback service module 406, wherein:

[0098] The message receiving module 402 is used to receive messages sent by the upstream business system;

[0099] The message conversion module 404 is used to determine the target message event corresponding to the message; obtain the conversion rule configuration information pre-configured for the target message event; process the message according to the conversion rule configuration information to obtain a new message that conforms to the business processing logic of the downstream business system;

[0100] The callback service module 406 is used to call back the new message to the service processing logic, so that the downstream service system performs service processing according to the new message during the execution of the service processing logic.

[0101] In one of the embodiments, the message conversion module 404 is also used to obtain the validation rule configuration information of the target message event; determine whether a specified field in the message meets the validation conditions set in the validation rule configuration information according to the validation rule configuration information; in response to the specified field meeting the validation conditions, execute the step of processing the message according to the conversion rule configuration information.

[0102] In one embodiment, the message conversion module 404 determines the target field from the message according to the conversion rule configuration information; extracts the target parameter from the target field; obtains the business specification information and business attribute information of the downstream business system; converts the target parameter into an expression form that conforms to the business specification of the downstream business system according to the business specification information; reorganizes and processes the converted target parameter and business attribute information to generate a new message.

[0103] In one of the embodiments, the component also includes a message binding module, which can be used to obtain a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list; and bind the message switch corresponding to each message event to its respective designated queue according to the binding rule configuration information.

[0104] In one of the embodiments, the component also includes an event orchestration module, which can be used to receive a real-time message event list reported by a downstream business system, and obtain binding rule configuration information corresponding to each message event in the real-time message event list from an event configuration terminal according to the real-time message event list.

[0105] In one of the embodiments, the event arrangement module is further used to periodically pull the real-time message event list and the binding rule configuration information corresponding to each message event in the real-time message event list from the event configuration terminal based on the scheduled task.

[0106] In one of the embodiments, the event orchestration module is further used to obtain a cached message event list from the cache; determine an invalid message event from the cached message event list; and the message binding module is further used to unbind the message switch of the invalid message event from the corresponding designated queue in response to the message switch of the invalid message event not being associated with a valid message event.

[0107] In one of the embodiments, the message binding module is also used to respond to the message switch of the invalid message event and also associate the valid message event, determine the type of the message switch of the invalid message event; in response to the type being a topic type, unbind the message switch of the invalid message event from its corresponding designated queue; in response to the type being a broadcast type, maintain the binding relationship between the message switch corresponding to the invalid message event and its corresponding designated queue.

[0108] For the specific definition of the message event processing component, please refer to the definition of the message event processing method above, which will not be repeated here. Each module in the above-mentioned message event processing component can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0109] Next, the message event processing method involved in this application is further described in conjunction with an application example. Figure 5 and Figure 6 As shown, Figure 5 The interactive sequence diagram between the modules of a message event processing component in one embodiment is shown, wherein the message event processing component may include a message receiving module, a message conversion module, an event buffer module, a log service module and a callback service module.

[0110] More specifically, the message receiving module receives the message sent by the upstream business system and transfers the message metadata to the message conversion module. The message conversion module queries the configuration information of the message event corresponding to the message from the event cache module, verifies and converts the message according to the configuration information, generates a new message, and uploads the processing log to the log service module. Then, the new message is passed to the callback business layer, and the callback business layer executes the callback method so that the downstream business system performs business processing according to the new message.

[0111] refer to Figure 6 As shown, Figure 6The interaction sequence diagram between the modules of the message event processing component in another embodiment is shown. The message event processing component may include a timed task module, an event arrangement module, an event cache module, a message binding module, a Rabbitmq module, and an event configuration module. Among them, the timed task module, the event arrangement module, the event cache module, the message binding module, and the Rabbitmq module can be loaded into the server of the downstream business system, and the event configuration module can be loaded into the terminal.

[0112] More specifically, the scheduled task module triggers the scheduled task at regular intervals, and the event arrangement module responds to the trigger by pulling the real-time message event list being subscribed by the downstream business system and the configuration information of each message event in the real-time message event list from the event configuration module. The event arrangement module queries the cache message event list from the event cache module and compares it with the real-time message event list, and instructs the event cache module to update the list, and then calls the message binding module. The message binding module executes the judgment logic to determine whether the invalid message event needs to be unbound. If so, it instructs the Rabbitmq module to unbind. If not, it can instruct the Rabbitmq module to complete the binding operation of the valid message event.

[0113] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a message event processing method is implemented.

[0114] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0115] In one of the embodiments, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: receiving a message sent by an upstream business system; determining a target message event corresponding to the message; obtaining conversion rule configuration information pre-configured for the target message event; processing the message according to the conversion rule configuration information to obtain a new message that complies with the business processing logic of the downstream business system; and calling back the new message to the business processing logic so that the downstream business system performs business processing according to the new message during the execution of the business processing logic.

[0116] In one of the embodiments, before the processor executes a computer program to process the message according to the conversion rule configuration information, it also implements the following steps: obtaining the verification rule configuration information of the target message event; judging whether a specified field in the message meets the verification condition set in the verification rule configuration information according to the verification rule configuration information; in response to the specified field meeting the verification condition, executing the step of processing the message according to the conversion rule configuration information.

[0117] In one of the embodiments, when a processor executes a computer program to process a message according to conversion rule configuration information and obtains a new message that conforms to the business processing logic of a downstream business system, the following steps are specifically implemented: determining a target field from the message according to the conversion rule configuration information; extracting target parameters from the target field; obtaining business specification information and business attribute information of the downstream business system; converting the target parameters into an expression that conforms to the business specifications of the downstream business system according to the business specification information; and reorganizing and processing the converted target parameters and business attribute information to generate a new message.

[0118] In one of the embodiments, the processor executes the computer program to further implement the following steps: obtaining a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list; binding the message switch corresponding to each message event to its respective designated queue according to the binding rule configuration information.

[0119] In one of the embodiments, when the processor executes a computer program to obtain a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list, the following steps are specifically implemented: receiving a real-time message event list reported by a downstream business system, and obtaining the binding rule configuration information corresponding to each message event in the real-time message event list from an event configuration terminal according to the real-time message event list.

[0120] In one of the embodiments, when the processor executes a computer program to obtain a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list, the following steps are specifically implemented: based on a scheduled task, the real-time message event list and the binding rule configuration information corresponding to each message event in the real-time message event list are periodically pulled from the event configuration terminal.

[0121] In one of the embodiments, the processor executes the computer program to further implement the following steps: obtaining a cached message event list from the cache; determining an invalid message event from the cached message event list; and in response to the message switch of the invalid message event not being associated with a valid message event, unbinding the message switch of the invalid message event from the corresponding designated queue.

[0122] In one of the embodiments, the processor executes the computer program to further implement the following steps: in response to the message switch of the invalid message event, the message switch also associates the valid message event and determines the type of the message switch of the invalid message event; in response to the type being a topic type, the message switch of the invalid message event is unbound from its corresponding designated queue; in response to the type being a broadcast type, the binding relationship between the message switch corresponding to the invalid message event and its corresponding designated queue is maintained.

[0123] In one of the embodiments, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: receiving a message sent by an upstream business system; determining a target message event corresponding to the message; obtaining conversion rule configuration information pre-configured for the target message event; processing the message according to the conversion rule configuration information to obtain a new message that conforms to the business processing logic of the downstream business system; and calling back the new message to the business processing logic so that the downstream business system performs business processing according to the new message during the execution of the business processing logic.

[0124] In one of the embodiments, before the computer program is executed by the processor to process the message according to the conversion rule configuration information, it also implements the following steps: obtaining the verification rule configuration information of the target message event; judging whether the specified field in the message meets the verification condition set in the verification rule configuration information according to the verification rule configuration information; in response to the specified field meeting the verification condition, executing the step of processing the message according to the conversion rule configuration information.

[0125] In one of the embodiments, when a computer program is executed by a processor to process a message according to conversion rule configuration information and obtain a new message that conforms to the business processing logic of a downstream business system, the following steps are specifically implemented: determining a target field from the message according to the conversion rule configuration information; extracting target parameters from the target field; obtaining business specification information and business attribute information of the downstream business system; converting the target parameters into an expression that conforms to the business specifications of the downstream business system according to the business specification information; and reorganizing and processing the converted target parameters and business attribute information to generate a new message.

[0126] In one of the embodiments, the computer program is executed by the processor to further implement the following steps: obtaining a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list; binding the message switch corresponding to each message event to its respective designated queue according to the binding rule configuration information.

[0127] In one of the embodiments, when the computer program is executed by a processor to obtain a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list, the following steps are specifically implemented: receiving a real-time message event list reported by a downstream business system, and obtaining the binding rule configuration information corresponding to each message event in the real-time message event list from an event configuration terminal according to the real-time message event list.

[0128] In one of the embodiments, when a computer program is executed by a processor to obtain a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list, the following steps are specifically implemented: based on a scheduled task, the real-time message event list and the binding rule configuration information corresponding to each message event in the real-time message event list are periodically pulled from an event configuration terminal.

[0129] In one of the embodiments, the computer program is executed by the processor to further implement the following steps: obtaining a cached message event list from the cache; determining an invalid message event from the cached message event list; in response to the message switch of the invalid message event not being associated with a valid message event, unbinding the message switch of the invalid message event from the corresponding designated queue.

[0130] In one of the embodiments, the computer program is executed by the processor to further implement the following steps: in response to the message switch of the invalid message event, the message switch also associates the valid message event and determines the type of the message switch of the invalid message event; in response to the type being a topic type, the message switch of the invalid message event is unbound from its corresponding designated queue; in response to the type being a broadcast type, the binding relationship between the message switch corresponding to the invalid message event and its corresponding designated queue is maintained.

[0131] Those skilled in the art can understand that all or part of the processes in the methods for implementing the above embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0132] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0133] In addition, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the characters in this article generally indicate that the associated objects before and after are in an "or" relationship.

[0134] It should be noted that, in the present invention, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order; terms such as "S202" and "S204" are used to distinguish steps, and do not necessarily mean that the method steps are performed in a specific order or sequential order; when the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The term "a plurality" in the present invention includes two or more, unless otherwise indicated.

[0135] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A message event processing method, the method is applied to a message event processing component loaded in a downstream business system, the method comprising: Receive messages sent by upstream business systems; Determine a target message event corresponding to the message; Based on the scheduled task, a real-time message event list is periodically pulled from the event configuration terminal, and configuration information of each message event is obtained according to the real-time message event list; wherein the configuration information includes: binding rule configuration information, verification rule configuration information and conversion rule configuration information; Binding the message switches corresponding to the message events to their respective designated queues according to the binding rule configuration information; Determine whether a specified field in the message meets the verification condition set in the verification rule configuration information according to the verification rule configuration information of the target message event, and if so, process the message according to the conversion rule configuration information of the target message event to obtain a new message that meets the business processing logic of the downstream business system; The new message is called back to the business processing logic, so that the downstream business system performs business processing according to the new message during the execution of the business processing logic.

2. The method according to claim 1, characterized in that The processing of the message according to the conversion rule configuration information to obtain a new message that complies with the business processing logic of the downstream business system includes: determining a target field from the message according to the conversion rule configuration information; extracting a target parameter from the target field; Obtaining business specification information and business attribute information of the downstream business system; Converting the target parameter into an expression form that complies with the business specification of the downstream business system according to the business specification information; The converted target parameters and the service attribute information are reorganized and processed to generate the new message.

3. The method according to claim 1, characterized in that Acquiring a real-time message event list and binding rule configuration information corresponding to each message event in the real-time message event list also includes: The real-time message event list reported by the downstream business system is received, and binding rule configuration information corresponding to each message event in the real-time message event list is acquired from an event configuration terminal according to the real-time message event list.

4. The method according to claim 1, characterized in that: The method further comprises: Get the cache message event list from the cache; Determine an invalid message event from the cache message event list; In response to the message switch of the invalid message event not being associated with a valid message event, the message switch of the invalid message event is unbound from the corresponding designated queue.

5. The method according to claim 4, characterized in that The method further comprises: The message switch in response to the invalid message event also associates the valid message event to determine the type of the message switch of the invalid message event; In response to the type being a topic type, unbinding the message switch of the invalid message event from its corresponding designated queue; In response to the type being a broadcast type, a binding relationship between the message switch of the invalidation message event and its corresponding designated queue is maintained.

6. A message event processing component, characterized in that: The component is applied to the downstream business system, and the component includes: Message receiving module, used to receive messages sent by upstream business systems; A message conversion module is used to determine the target message event corresponding to the message, periodically pull the real-time message event list from the event configuration terminal based on the timed task, and obtain the configuration information of each message event according to the real-time message event list; wherein the configuration information includes: binding rule configuration information, verification rule configuration information and conversion rule configuration information; according to the binding rule configuration information, the message switch corresponding to each of the message events is bound to the respective designated queue; according to the verification rule configuration information of the target message event, it is determined whether the designated field in the message meets the verification condition set in the verification rule configuration information; if so, the message is processed according to the conversion rule configuration information of the target message event to obtain a new message that meets the business processing logic of the downstream business system; The callback service module is used to call back the new message to the service processing logic, so that the downstream service system performs service processing according to the new message during the execution of the service processing logic.

7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Data processing method and system, computer equipment and storage medium

    CN113687958A