Business processing method, apparatus, business system and device, computer program product

By deploying multiple active front-end processor nodes in the front-end processor cluster and using message queues to process session connections and business messages, the session consistency problem of multiple front-end processor clusters in the single certificate mode is solved, achieving session consistency and system flexibility.

CN119996483BActive Publication Date: 2025-10-14中国邮政储蓄银行股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510208443.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-10-14
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

In banking systems, when multiple front-end processors are deployed in a cluster under a single certificate model, session consistency issues are difficult to resolve, resulting in incorrect routing of business requests and affecting subsequent business processing.

Method used

Multiple active front-end nodes are deployed in the front-end cluster. Each node creates a first consumer and a second consumer based on the message queue. The message queue is used to process session connections and business messages, and the message topics and tags are used for filtering to ensure session consistency and load balancing.

Benefits of technology

It implements active-active deployment of front-end clusters in single-certificate mode, ensures session consistency, improves system flexibility and scalability, and avoids incorrect routing caused by inconsistent session information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996483B_ABST
    Figure CN119996483B_ABST
Patent Text Reader

Abstract

The application discloses a kind of business processing method, device, business system and equipment, computer program product, the method is executed by the preprocessor cluster of multiple active preprocessor node being deployed, first consumer and second consumer are created in preprocessor node, based on first consumer processing core business cluster's session connection message and through target preprocessor node establishes the session connection of core business cluster and third party system;After establishing session connection, session initialization message is sent through target preprocessor node, and the message carries business channel identifier and the IP address of target preprocessor node;Based on second consumer, the service message of core business cluster is received and the service message is consumed through target preprocessor node.The application is associated based on message queue business channel and preprocessor IP address, multiple active deployment of preprocessor cluster is realized, the consistency of session is guaranteed, and the decoupling of preprocessor and core business is realized, improve system flexibility and scalability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of business processing, and in particular to a business processing method and device, a business system and equipment, and a computer program product. BACKGROUND

[0002] In a banking system, data accessed by a third-party system usually involves data exchange and system integration with external service providers (such as payment gateways, financial information service providers, credit rating agencies, identity authentication service providers, etc.). Such data access needs to ensure security, high availability, session consistency and data consistency, especially when dealing with sensitive financial information. With the continuous improvement of the level of bank digitization, for scenarios with a large number of business types and complex business processes, the banking industry has gradually formed a general system architecture model combining third-party systems, front-end machine clusters and core business clusters, in which the core business cluster and the front-end machine cluster are combined as a business system cluster.

[0003] Generally, in order to ensure security, the third-party system uses TCP protocol and TLS / SSL channel encryption technology to authenticate the login of the front-end system user. After the business channel user logs in successfully, a session is established between the front-end machine and the third-party system, and the information interaction of both is maintained based on the session. Due to security and management considerations, the third-party system provides a single certificate, and the business channel session establishment adopts a single certificate mode, that is, at the same time, a channel user can only log in to one front-end server and establish a session on the front-end server. In a multi-front-end machine cluster deployment, since all front-end servers use the same certificate for encrypted communication, the cross-system session consistency problem becomes complex. Different front-end machine nodes do not know each other's session information, which may lead to the following problems: if the business system cannot accurately determine which front-end machine node has established a connection with the third-party system, the session request may be incorrectly routed to an incorrect node, thereby affecting subsequent business processing.

[0004] To solve the above problems, several solutions are provided in the prior art, including a Redis-based distributed session management, an API gateway-based session management, and a message queue-based event-driven architecture. However, these solutions still have different limitations when dealing with distributed session consistency and cross-system session management, such as increasing data transmission risks, being unable to ensure session information consistency, etc. SUMMARY

[0005] The embodiments of the present application provide a business processing method, device, system and equipment, and a computer program product to realize multi-live deployment of a front-end machine cluster in a single certificate mode and ensure session consistency.

[0006] The embodiments of the present application adopt the following technical solutions:

[0007] In a first aspect, the embodiments of the present application provide a service processing method, the service processing method is executed by a front-end machine cluster, a plurality of active front-end machine nodes are deployed in the front-end machine cluster, a first consumer and a second consumer based on a message queue are created in each of the front-end machine nodes, and the service processing method comprises:

[0008] processing session connection messages of a core service cluster based on the first consumer and establishing a session connection between the core service cluster and a third-party system through a target front-end machine node, the target front-end machine node being one of the plurality of active front-end machine nodes;

[0009] in a case where the session connection is successfully established, sending a session initialization message through the target front-end machine node, the session initialization message carrying a service channel identifier and an IP address of the target front-end machine node, so that a service node of the core service cluster caches the service channel identifier and the IP address of the target front-end machine node;

[0010] receiving a service message of the core service cluster based on the second consumer and consuming the service message through the target front-end machine node, the service message carrying a label, the label being set as the IP address of the target front-end machine node corresponding to the cached service channel identifier.

[0011] Optionally, the processing of the session connection messages of the core service cluster based on the first consumer and the establishment of the session connection between the core service cluster and the third-party system through the target front-end machine node comprise:

[0012] receiving the session connection messages of the core service cluster based on a subscribed connection message topic, the session connection messages carrying a service channel identifier;

[0013] in a single certificate mode, establishing a communication connection between the front-end machine node and the third-party system;

[0014] determining the target front-end machine node among the plurality of active front-end machine nodes based on a load balancing strategy;

[0015] based on the communication connection between the target front-end machine node and the third-party system, forwarding the session connection messages to the third-party system, so that the third-party system performs user identity authentication according to the session connection messages.

[0016] Optionally, the sending of the session initialization message through the target front-end machine node in the case where the session connection is successfully established comprises:

[0017] receiving a session connection success message returned by the third-party system;

[0018] generating a session initialization message based on the session connection success message;

[0019] sending the session initialization message to a message queue through the target front-end node, so that a service node of a core service cluster subscribed to the session initialization message receives the session initialization message.

[0020] Optionally, the receiving, by the second consumer, of the service message of the core service cluster and the consuming, by the target front-end node, of the service message include:

[0021] receiving the service message of the core service cluster based on a service message topic to which the second consumer subscribes;

[0022] determining the target front-end node based on a label corresponding to the second consumer and a label carried in the service message, and consuming the service message through the target front-end node.

[0023] Optionally, the first consumer is created in the following manner:

[0024] creating an implementation class of a first message receiving processing interface;

[0025] adding a first annotation to the implementation class of the first message receiving processing interface, the first annotation being used to establish a corresponding consumer group and a subscription connection message topic for each front-end node.

[0026] Optionally, the second consumer is created in the following manner:

[0027] creating an implementation class of a second message receiving processing interface;

[0028] adding a second annotation to the implementation class of the second message receiving processing interface, the second annotation being used to establish a corresponding consumer group and a label for each front-end node and to subscribe to a service message topic, the service message topic being configured as a service name of the front-end node.

[0029] Optionally, the service processing method further includes:

[0030] in a case where a session connection triggering termination condition occurs, sending a session termination message to a message queue, so that a service node of a core service cluster subscribed to the session termination message receives the session termination message.

[0031] In a second aspect, the embodiments of the present application further provide a service processing device, which is applied to a front-end cluster, the front-end cluster is deployed with multiple active front-end nodes, each of the front-end nodes is created with a first consumer and a second consumer based on a message queue, and the service processing device includes:

[0032] a first consumer unit, configured to process a session connection message of the first consumer based on the first consumer processing core service cluster, and establish a session connection between the core service cluster and a third party system through a target front-end node, the target front-end node being one of the multi-active front-end nodes;

[0033] a first sending unit, configured to send a session initialization message through the target front-end node in a case where the session connection is successfully established, the session initialization message carrying a service channel identifier and an IP address of the target front-end node, so that a service node of the core service cluster caches the service channel identifier and the IP address of the target front-end node;

[0034] a second consumer unit, configured to receive a service message of the core service cluster based on the second consumer, and consume the service message through the target front-end node, the service message carrying a label, the label being set as the IP address of the target front-end node corresponding to the cached service channel identifier.

[0035] In a third aspect, an embodiment of the present application further provides a service system, the service system comprising a core service cluster and a front-end cluster, the front-end cluster being configured to execute any of the service processing methods.

[0036] Optionally, the core service cluster comprises a plurality of service nodes, and the service nodes are further configured to:

[0037] receive a session initialization message based on a subscription, the session initialization message carrying a service channel identifier and an IP address of a front-end node;

[0038] cache the service channel identifier and the IP address of the front-end node.

[0039] Optionally, the service nodes are further configured to:

[0040] receive a service request, and acquire a service channel identifier according to the service request;

[0041] acquire an IP address of a front-end node corresponding to the service channel identifier from the cache according to the service channel identifier;

[0042] encapsulate a service message according to the service request and the IP address of the front-end node;

[0043] send the service message to a message queue with a service name of the front-end node as a message topic, and set a label of the service message as the IP address of the front-end node.

[0044] In a fourth aspect, an embodiment of the present application further provides a device, comprising:

[0045] a processor; and a memory arranged to store computer-executable instructions that, when executed, cause the processor to perform any of the preceding business processing methods.

[0046] In a fifth aspect, the embodiments of the present application further provide a computer program product, comprising computer programs / instructions, which, when executed by a processor, implement any of the preceding business processing methods.

[0047] The above at least one technical scheme adopted by the embodiments of the present application can achieve the following beneficial effects: the business processing method of the embodiments of the present application is executed by a front-end machine cluster, the front-end machine cluster is deployed with multi-live front-end machine nodes, a first consumer and a second consumer based on a message queue are created in each front-end machine node, the business processing method comprises: processing a session connection message of a core business cluster based on the first consumer and establishing a session connection between the core business cluster and a third-party system through a target front-end machine node, the target front-end machine node being one of the multi-live front-end machine nodes; in the case of successfully establishing the session connection, sending a session initialization message through the target front-end machine node, the session initialization message carrying a business channel identifier and an IP address of the target front-end machine node, so that a business node of the core business cluster caches the business channel identifier and the IP address of the target front-end machine node; receiving a business message of the core business cluster based on the second consumer and consuming the business message through the target front-end machine node, the business message carrying a tag, the tag being set as the IP address of the target front-end machine node corresponding to the cached business channel identifier. The business processing method of the embodiments of the present application is based on a message queue, under the premise of meeting security, by associating a business channel with a front-end machine IP address, using a message topic and a tag for message filtering, multi-live deployment of a front-end machine cluster and a core business cluster is realized, session consistency is ensured, and the introduction of the message queue also realizes decoupling of the front-end machine and the core business, improving flexibility and scalability of the entire system. BRIEF DESCRIPTION OF DRAWINGS

[0048] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the present application. In the drawings:

[0049] Figure 1 a flowchart of a business processing method in the embodiments of the present application;

[0050] Figure 2 a flowchart of a business processing method in the embodiments of the present application;

[0051] Figure 3 a structural diagram of a business processing device in the embodiments of the present application;

[0052] Figure 4 Figure 1 is a structural schematic diagram of an apparatus in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described below in detail with the embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0054] The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the drawings.

[0055] The technical terms involved in the present application mainly include:

[0056] 1) RocketMQ: RocketMQ is an open-source distributed message middleware developed by Alibaba, which supports transaction messages, sequential messages, batch messages, timed messages, message backtracking, etc. The system is composed of Producer, Consumer, Broker, NameServer, etc. Consumers filter messages by subscribing to different topics (Topics) and tags (Tags).

[0057] 2) Redis: Redis (Remote Dictionary Server) is an open-source in-memory database that complies with the BSD protocol. It provides a high-performance key-value storage system and is commonly used in caching, message queuing, session storage, and other application scenarios. Redis not only supports simple key-value type data, but also provides list, set, zset (ordered set), hash, and other data structure storage, which can better meet specific business needs.

[0058] 3) IP address: IP (Internet Protocol) is the Internet Interconnection Protocol that requires all devices on the network to have a unique IP address.

[0059] 4) Front-end machine: In the system architecture of banks and other financial institutions, the "front-end machine" usually refers to an intermediate layer device or system that performs data caching, forwarding, and isolation between the internal network and the external network. It serves as a bridge between core business systems and external systems (such as third-party payment platforms, partners, other financial institutions, etc.), and undertakes multiple key tasks such as data exchange, protocol adaptation, performance optimization, etc. As an intermediary role connecting the internal and external networks, it has important functions such as caching and database isolation.

[0060] 5) Business Channel: In financial services, "Business Channel" is not just a way or platform to communicate with customers, it also involves the management and processing of transactions, especially for different transaction types (such as repo, foreign exchange transactions, etc.). By assigning different channel accounts for different types of RFT (Request for Tender), ODM (Order driven Market) and RFQ (Request For Quotation) and other transaction requests, financial institutions such as banks can effectively manage and control different transaction types, ensuring safe, compliant and efficient transaction execution. This design helps improve transaction transparency and operational flexibility, while enhancing risk management capabilities for complex transaction types.

[0061] To address the problem of session routing errors that may occur in single certificate mode, the following solutions are provided in the existing technology:

[0062] 1) Redis-based distributed session management

[0063] Redis is a high-performance caching and storage solution commonly used to implement distributed session management. In this solution, session information is stored in a Redis cluster, and multiple services can share session state through Redis.

[0064] 2) API gateway-based session management

[0065] In microservices architecture, API gateways (such as Kong, Nginx, etc.) can be used to handle cross-service request routing, authentication and session management. API gateways carry session information in the request header and pass it to the backend service to identify the user's session state.

[0066] 3) Event-driven architecture based on message queue

[0067] In some event-driven architectures, message queues are used to handle inter-system asynchronous communication. In this solution, message queues are used to decouple systems and can pass some event information between systems, such as user login, session changes, etc. Common implementations include: Kafka or RabbitMQ-based event-driven architecture, systems synchronize state changes through message passing. For example, after a user logs in, the login event is sent to the core business system, front-end system, etc. through the message queue, and the relevant systems synchronize the session information by consuming these messages.

[0068] The above solutions have different limitations in handling distributed session consistency and cross-system session management, which are manifested as follows:

[0069] 1) Redis-based distributed session management

[0070] In a microservice architecture combining front-end machine clusters and core business clusters, the front-end machine serves as an isolation layer between the internal and external networks, preventing external applications from directly accessing the core business system and enhancing system security. If the front-end machine cluster and the core business cluster jointly participate in Redis distributed session management, consistency can be provided, but the risk of core business data being stolen or tampered with during transmission is increased.

[0071] 2) API gateway-based session management

[0072] This solution is mainly applicable to request routing and authentication and does not involve session information synchronization or distributed session management across multiple systems. If the system has multiple front-end machines and services, the API gateway cannot automatically synchronize session information, resulting in inconsistent session information.

[0073] 3.) Message queue-based event-driven architecture

[0074] This solution provides asynchronous and decoupling, but in a complex multi-front-end machine cluster and distributed session management environment, it is still a challenge to correctly route session information in a single certificate mode in a multi-front-end machine cluster to ensure that subsequent business requests can be processed correctly. If the message queue subscription and consumption strategy is not properly designed, it may cause delays or inconsistencies in session state updates, especially in a multi-system and cluster environment.

[0075] In summary, in a banking system, the single certificate mode can effectively ensure the security of communication and ensure the reliability of encrypted transmission and identity verification. However, in a complex multi-front-end machine cluster environment, there are problems with session management and load balancing using existing solutions: the single certificate mode may cause session consistency problems, making it difficult to load business channel requests to a specific front-end machine that has established a connection with a third-party system. In the case of multi-active cluster deployment of front-end machines, business cannot be carried out and smoothly conducted.

[0076] Therefore, the embodiments of the present application provide a business processing method, which is executed by a front-end machine cluster, and the front-end machine cluster is deployed with multi-active front-end machine nodes, and a first consumer and a second consumer based on a message queue are created in each front-end machine node.

[0077] The service processing method of the embodiment of the application is executed by a front-end machine cluster, the front-end machine cluster is deployed with multiple active front-end machine nodes, two consumers are created in each front-end machine node based on a message queue, and the two consumers process connection messages and service messages from service channels respectively, so as to realize more efficient message processing, decouple different types of service logic, and improve the scalability and fault tolerance of the system.

[0078] Further, as shown in Figure 1 , a flowchart of a service processing method in the embodiment of the application is provided, and the service processing method comprises at least the following steps S110 to S130:

[0079] In step S110, session connection messages of the core service cluster are processed based on the first consumer, and a session connection between the core service cluster and a third-party system is established through a target front-end machine node, the target front-end machine node being one of the multiple active front-end machine nodes.

[0080] In combination Figure 2 , a whole flowchart of a service processing method in the embodiment of the application is provided. The first consumer is used to listen to and process session connection request messages from the core service cluster. When a core service cluster (a collection of multiple service nodes) needs to establish a session connection with a third-party system (such as a payment gateway, a database service, etc.), it sends a session connection request message to a message queue of the front-end machine cluster. The first consumer is responsible for listening to the message queue, and once a session connection request message is detected, a target front-end machine node (one of the multiple active front-end machine nodes) is selected according to a load balancing strategy or other rules to process the message.

[0081] The selected front-end machine node, i.e., the target front-end machine node, is responsible for actually establishing a session connection with the third-party system, and the connection can be realized based on TCP / IP or other communication protocols.

[0082] In step S120, in the case of successful establishment of the session connection, a session initialization message is sent through the target front-end machine node, and the session initialization message carries a service channel identifier and an IP address of the target front-end machine node, so that the service nodes of the core service cluster cache the service channel identifier and the IP address of the target front-end machine node.

[0083] After the target front-end machine node successfully establishes a session connection with the third-party system, the target front-end machine node sends a session initialization message through the message queue. The session initialization message contains two key information:

[0084] 1) Business channel identifier: This is a unique identifier of a business channel, which is used to distinguish different business channels or business flows, and it helps the core business cluster to know which business channel needs to use this session connection.

[0085] 2) IP address of the target front-end node: This is the network address of the target front-end node, which needs to be known by the core business cluster in order to route the business message to the correct front-end node in the future, thereby ensuring session consistency.

[0086] After the core business cluster receives the session initialization message, it caches the business channel identifier and the IP address of the target front-end node in the message for subsequent business processing.

[0087] It should be noted that, in addition to using the IP address of the front-end node as the unique identifier associated with the business channel, a globally unique ID generated by a snowflake algorithm or the like can also be used to replace the front-end IP address, and the purpose of associating the business channel with the corresponding front-end node can also be achieved.

[0088] Step S130, based on the second consumer receiving the business message of the core business cluster and consuming the business message through the target front-end node, the business message carrying a label, the label being set as the IP address of the target front-end node corresponding to the cached business channel identifier.

[0089] The role of the second consumer is to listen to and process the business message from the core business cluster. The business message contains specific business data that needs to be processed and label information. This label is set to the IP address of the target front-end node corresponding to the previously cached business channel identifier. When the second consumer receives the subscribed business message, it needs to judge whether to process the business message in combination with its own IP address and the label carried in the business message. Since the label has been associated with the IP address of the target front-end node, it can be ensured that the business message is consumed by the correct node.

[0090] The message queue used by the business processing method of the embodiment of the application may be, for example, RocketMQ, RabbitMQ, etc. The specific form of the message queue can be selected flexibly by those skilled in the art according to actual needs, and is not limited here.

[0091] The business processing method of the embodiment of the application is based on a message queue. On the premise of meeting security, by associating the business channel with the front-end IP address, using message topics and labels for message filtering, the multi-active deployment of the front-end cluster and the core business cluster is realized, the session consistency is ensured, and the introduction of the message queue also realizes the decoupling of the front-end and the core business, improving the flexibility and scalability of the entire system.

[0092] In some embodiments of the present application, the establishing of the session connection between the core service cluster and the third-party system based on the session connection message of the first consumer processing core service cluster and through the target front-end node includes: receiving the session connection message of the core service cluster based on the subscription connection message topic, the session connection message carrying the business channel identifier; in the single certificate mode, establishing a communication connection between the front-end node and the third-party system; determining the target front-end node in the multi-live front-end node based on the load balancing strategy; forwarding the session connection message to the third-party system based on the communication connection between the target front-end node and the third-party system, so that the third-party system performs user identity authentication according to the session connection message.

[0093] The first consumer in the front-end cluster subscribes to a specific message topic, which is used to receive session connection requests from the core service cluster. When the core service cluster needs to establish a session connection with a third-party system, it sends a session connection message containing a business channel identifier to the message queue of this topic. The business channel identifier is an important information that distinguishes different business channels or business scenarios, ensuring that messages can be correctly processed and routed.

[0094] After the microservices of the core service cluster are started, they will encapsulate session connection messages for different channels, which contain the code attribute identifying different business channels. The microservices of the core service cluster send the encapsulated messages to the message queue with the topic of session connection (such as "tdconnect"). The front-end cluster subscribes to the message with the topic of "tdconnect", so it will receive the connection message. Then the target front-end node that receives the connection message sends the connection message to the third-party system. After the third-party system receives the session connection message, it performs user identity authentication according to the information in the message, thereby establishing a session connection with the core service cluster.

[0095] Because each front-end node server saves the certificate file issued by the certificate authority recognized by the National Cryptographic Administration, the front-end node and the third-party system can establish a TCP connection in single certificate mode, and establish an encrypted connection channel according to the file path of the certificate on the Linux server. Single certificate mode means that all nodes in the front-end cluster use the same certificate for identity authentication and encrypted communication.

[0096] In the above steps, a target pre-processor node can also be selected among the multi-live pre-processor nodes according to a load balancing strategy (such as round robin, least connection number, hash algorithm, etc.). The purpose of the load balancing strategy is to ensure uniform distribution of session connections and avoid the situation that some nodes are overloaded while other nodes are idle. The process of selecting the target pre-processor node can be dynamic, adjusted according to real-time load conditions, node health status, etc. Of course, how to set the load balancing strategy can be flexibly set by those skilled in the art according to actual needs, which is not limited here.

[0097] The embodiments of the present application improve the scalability and flexibility of the system through the deployment of multi-live pre-processor nodes and the use of load balancing strategies. In the multi-live pre-processor cluster, even if a node fails or is maintained, other nodes can still continue to process session connection requests to ensure business continuity.

[0098] In some embodiments of the present application, in the case of successful establishment of a session connection, the target pre-processor node sends a session initialization message, which includes: receiving a session connection success message returned by the third-party system; generating a session initialization message based on the session connection success message; and sending the session initialization message to a message queue through the target pre-processor node, so that a business node of a core business cluster that subscribes to the session initialization message receives the session initialization message.

[0099] The third-party system authenticates the pre-processor login user and returns a connection success message after authentication. After receiving the feedback of the third-party system connection success, the pre-processor cluster generates a session initialization message and sends it through a message queue. The session initialization message contains the business channel code attribute carried in the connection request, the local IP address of the pre-processor, and other necessary session information.

[0100] Each node in the core business cluster subscribes to the session initialization message. When the core business cluster receives the session initialization message, it saves the business channel code attribute and the pre-processor IP address in the session initialization message to the cache in the form of hash, etc., and updates the session mapping table. The session mapping table here can maintain the mapping relationship between the business channel code attribute and the pre-processor IP address in the form of key-value.

[0101] The above cache technology can be implemented based on Redis, MongoDB, or Memecache cache middleware. The specific cache technology can be flexibly selected by those skilled in the art according to actual needs, which is not limited here.

[0102] By carrying the service channel code attribute and the local IP address of the front-end machine in the session initialization message, each service node can maintain the mapping relationship between the service channel code attribute and the front-end node based on the cache, thereby providing strong support for the correct routing of subsequent session messages and ensuring session consistency.

[0103] In some embodiments of the present application, the receiving, by the second consumer, of the service message of the core service cluster and the consumption, by the target front-end node, of the service message include: receiving, by the second consumer, the service message of the core service cluster based on a service message topic to which the second consumer subscribes; and determining the target front-end node based on a label corresponding to the second consumer and a label carried in the service message and consuming the service message by the target front-end node.

[0104] The second consumer will subscribe to the service message topics published by the core service cluster, which are usually divided according to business logic and message type, to ensure that the second consumer can receive the service messages related to it. Once the core service cluster publishes new service messages to the topics subscribed by the second consumer, the second consumer can receive these messages.

[0105] After receiving the service message, the front-end node corresponding to the second consumer needs to determine whether it can be the target front-end node that needs to process the service message according to its own label and the label carried in the service message. If the front-end node corresponding to the second consumer needs to match its own label and the label carried in the service message, the front-end node corresponding to the second consumer is the target front-end node, i.e., the front-end node consumes the service message, thereby realizing the correct routing of the service channel message to the front-end machine.

[0106] In some embodiments of the present application, in the front-end cluster, each front-end node saves the IP address of its own node as a system attribute when the application is started.

[0107] In the microservice startup method, the InetAddress.getLocalHost method is used to obtain the IP address of the own node and assign it to LOCAL_IP, for example, System.setProperty(“localIp” LOCAL_IP) can be used to assign LOCAL_IP, and the IP address of the microservice is set as an environment variable.

[0108] In some embodiments of the present application, the first consumer is created in the following way: an implementation class of a first message receiving processing interface is created; a first annotation is added to the implementation class of the first message receiving processing interface, and the first annotation is used to establish a corresponding consumer group and subscribe to a connection message topic for each front-end node.

[0109] The first consumer is responsible for processing the business channel connection message. Taking the RocketMQ message queue as an example, when the first consumer is created, a class implementing the RocketMQListenr interface can be created first, and the @RocketMQMessageListener annotation is added to the class, with consumerGroup = "tdconnect" and topic = "tdconnect".

[0110] By creating a class implementing a specific message receiving and processing interface and adding an annotation to the class to configure the message listener, an efficient, flexible and reliable message processing mechanism is achieved. This provides a strong guarantee for the scalability, performance optimization, centralized management and reliability of the system. At the same time, it simplifies the configuration process of message processing logic and improves development efficiency.

[0111] In some embodiments of the present application, the second consumer is created by creating an implementation class of a second message receiving and processing interface, and adding a second annotation to the implementation class of the second message receiving and processing interface, which is used to establish corresponding consumer groups and tags for each front-end machine node and subscribe to business message topics. The business message topic is configured as the service name of the front-end machine node.

[0112] The second consumer is responsible for processing business messages. Taking the RocketMQ message queue as an example, when the second consumer is created, the microservice first introduces the development dependency of RocketMQ, creates a class implementing the RocketMQListenr interface, and adds the @RocketMQMessageListener annotation to the class, with consumerGroup = "${spring.application.name}${local.ip}" and selectorExpression = "${local.ip}", indicating that the corresponding consumer group and tag (local.ip) are established for the front-end system cluster node, and topic = "${spring.application.name}", which is used to determine the subscribed message topic.

[0113] The "application.name" in the above topic is the service name of the front-end machine node. The topic of the message queue is named after the service. When different services use the message queue for communication, the sender and consumer of the message need to be specified. Therefore, when the core business cluster and the front-end cluster interact, the service name of the front-end machine node needs to be dynamically obtained and mapped to the consumer of the business message.

[0114] Based on the above embodiments, the system attributes and the consumer are all initialized after the Spring microservice is started.

[0115] In some embodiments of the present application, the business processing method further includes: in the case that the session connection triggers the termination condition, sending a session termination message to the message queue, so that the business nodes of the core business cluster subscribed to the session termination message receive the session termination message.

[0116] When the session triggers the end condition, such as user logout or session timeout, the front-end machine system sends a "session termination" message through the message queue. This message will inform the core business cluster that the session has ended, and any subsequent request is no longer valid. In the core business cluster, each business node subscribes to the message queue of the session termination message to receive the session termination message.

[0117] By decoupling the session termination event from the core business logic and processing it asynchronously through the message queue, each part of the system can be made more independent and flexible. Even if a part fails or performance declines, it will not have a significant impact on the entire system. At the same time, this decoupling and asynchronous processing method also makes the system easier to expand and upgrade.

[0118] The embodiments of the present application also provide a business processing device 300, as shown in Figure 3 The structure schematic diagram of a business processing device in the embodiments of the present application is provided, and the business processing device 300 is applied to a front-end machine cluster, the front-end machine cluster is deployed with multiple active front-end machine nodes, the first consumer and the second consumer based on the message queue are created in each front-end machine node, and the business processing device 300 includes a first consumption unit 310, a first sending unit 320 and a second consumption unit 330, wherein:

[0119] The first consumption unit 310 is used for processing the session connection message of the core business cluster based on the first consumer and establishing the session connection between the core business cluster and the third-party system through the target front-end machine node, and the target front-end machine node is one of the multiple active front-end machine nodes.

[0120] The first sending unit 320 is used for sending the session initialization message through the target front-end machine node in the case of successfully establishing the session connection, and the session initialization message carries the business channel identifier and the IP address of the target front-end machine node, so that the business nodes of the core business cluster cache the business channel identifier and the IP address of the target front-end machine node.

[0121] The second consumption unit 330 is configured to receive a service message of the core service cluster based on the second consumer and consume the service message through the target front-end node, and the service message carries a label, and the label is set as an IP address of the target front-end node corresponding to the buffered service channel identifier.

[0122] In some embodiments of the present application, the first consumption unit 310 is specifically configured to receive a session connection message of the core service cluster based on a subscribed connection message topic, the session connection message carries a service channel identifier, establish a communication connection between the front-end node and the third-party system in a single certificate mode, determine the target front-end node in the multi-live front-end node based on a load balancing strategy, and forward the session connection message to the third-party system based on the communication connection between the target front-end node and the third-party system, so that the third-party system performs user identity authentication according to the session connection message.

[0123] In some embodiments of the present application, the first sending unit 320 is specifically configured to receive a session connection success message returned by the third-party system, generate a session initialization message based on the session connection success message, and send the session initialization message to a message queue through the target front-end node, so that a service node of the core service cluster subscribed to the session initialization message receives the session initialization message.

[0124] In some embodiments of the present application, the second consumption unit 330 is specifically configured to receive a service message of the core service cluster based on the second consumer subscribed to a service message topic, and determine the target front-end node based on a label corresponding to the second consumer and a label carried in the service message and consume the service message through the target front-end node.

[0125] In some embodiments of the present application, the first consumer is created in the following manner: an implementation class of a first message receiving processing interface is created, a first annotation is added to the implementation class of the first message receiving processing interface, and the first annotation is used to establish a corresponding consumption group and a subscription connection message topic for each front-end node.

[0126] In some embodiments of the present application, the second consumer is created in the following manner: an implementation class of a second message receiving processing interface is created, a second annotation is added to the implementation class of the second message receiving processing interface, and the second annotation is used to establish a corresponding consumption group and a label and a subscription service message topic for each front-end node, and the service message topic is configured as a service name of the front-end node.

[0127] In some embodiments of the present application, the service processing apparatus 300 further comprises a second sending unit configured to send a session termination message to the message queue in the case that the session connection triggering termination condition is met, so that the service nodes of the core service cluster subscribed to the session termination message receive the session termination message.

[0128] It can be understood that the service processing apparatus described above can implement each step of the service processing method provided in the foregoing embodiments, and the related explanations about the service processing method are all applicable to the service processing apparatus, which will not be repeated here.

[0129] The embodiments of the present application further provide a service system, which comprises a core service cluster and a front-end cluster, and the front-end cluster is configured to execute any one of the service processing methods.

[0130] In some embodiments of the present application, the core service cluster comprises a plurality of service nodes, and the service nodes are further configured to receive a session initialization message based on the subscribed session initialization message, the session initialization message carrying a service channel identifier and an IP address of a front-end node; and cache the service channel identifier and the IP address of the front-end node.

[0131] In the core service cluster, each service node subscribes to the message queue of the session initialization message. This means that when a session initialization message is generated, the corresponding session initialization message will be sent to the message queue, and the service nodes can receive these messages in real time. When the service node receives the session initialization message, it will parse the message content, extract the service channel identifier and the IP address of the front-end node and cache them. The caching is usually performed in the local memory of the service node to ensure fast access and update. The form of caching can be to cache the service channel identifier and the IP address of the front-end node in the form of hash.

[0132] By caching the service channel identifier and the IP address of the front-end node, the service node can find the corresponding front-end node more quickly when processing a service request subsequently, and establish a connection with the front-end node, which on the one hand reduces the time overhead of searching and routing, improves the efficiency of service processing, and on the other hand ensures that the service message can be routed to the correct front-end node, thereby ensuring the session consistency.

[0133] In some embodiments of the present application, the service node is further configured to: receive a service request, and obtain a service channel identifier according to the service request; obtain the IP address of the front-end node corresponding to the service channel identifier from the cache according to the service channel identifier; encapsulate a service message according to the service request and the IP address of the front-end node; send the service message to a message queue with a service name of the front-end node as a message topic, and set the tag of the service message as the IP address of the front-end node.

[0134] Taking the transaction scenario of a bank as an example, after receiving a transaction request of a front-end trader, the core service cluster first obtains the code corresponding to the service channel, and then obtains the IP address of the front-end node corresponding to the service channel from the session mapping table of the Redis cache through the code, and then encapsulates a service message, dynamically obtains the service name of the front-end node, determines the message topic (i.e. topic = “${spring.application.name}) to be subscribed, sends the service message to the message queue with the service name of the corresponding front-end node as the message topic, sets the tag of the message as the IP address of the corresponding front-end node, adds the corresponding hashkey, and puts the message into the specified queue in the order of the service.

[0135] Since the subscription group and the tag of the consumer for processing the service message are different in each front-end node, after receiving the message of the service channel, the front-end node will only consume the service message when the tag of the consumer group of the front-end node matches the tag in the message, so as to realize the correct routing of the service channel message to the front-end node.

[0136] In summary, the key points of the present application are mainly as follows:

[0137] 1) The name of the micro service is used as the name of the consumer, a unique identifier is generated for each node of the front-end cluster, and the unique identifier is used as a global variable to associate the generation of the consumer, and the tag and the consumer group name of the consumer are associated with the unique identifier;

[0138] 2) Different service channels are associated with unique identifiers, and when the messages are sent and received between the service clusters, the unique identifier in the cache is obtained through the service channel code, the tag carried by the encapsulated service message is the unique identifier, and the correct routing and load balancing of the traffic are realized by filtering through the consumer group and the tag of the message queue and processing by different front-end nodes.

[0139] The application achieves at least the following technical effects:

[0140] The application is based on a message queue, and under the premise of meeting security, the business channel and the IP address of the front-end machine are associated, message filtering is performed by using a message topic and a label, the multi-live deployment of the front-end machine cluster and the core business cluster is achieved, and the load of traffic in various business scenarios is guaranteed. The introduction of the message queue also achieves the decoupling of the front-end machine and the core business, and improves the flexibility and scalability of the entire system.

[0141] Figure 4 is a structural schematic diagram of a device in an embodiment of the application. As shown in Figure 4 The device includes one or more processors (or processing units), can also include one or more memories coupled to the processors, and can also include a communication module coupled to the processors.

[0142] The communication module can be used for communication with other devices or apparatuses, such as transmission or reception of data and / or signals. The communication module can have at least one communication module for communication. The communication module can include any interface necessary for communication with other devices. Illustratively, the communication module can be a transceiver, a circuit, a bus, a module, or other types of communication modules.

[0143] The processor can include, but is not limited to, at least one of the following: a general-purpose computer, a special-purpose computer, a microcontroller, a digital signal controller (Digital Signal Processor, DSP), or one or more of a controller-based multi-core controller architecture. The device can have multiple processors, such as application-specific integrated circuit chips, which are time-dependent on a clock synchronized with the main processor.

[0144] The memory can include one or more non-volatile memories and one or more volatile memories. Examples of non-volatile memories include, but are not limited to, at least one of the following: read-only memory (Read-Only-Memory, ROM), erasable programmable read-only memory (Electrically Programmable Read-Only-Memory, EPROM), flash memory, hard disk, compact disc (Compact Disc, CD), digital video disk (Digital Video Disk, DVD), or other magnetic storage and / or optical storage. Examples of volatile memories include, but are not limited to, at least one of the following: random access memory (Random Access Memory, RAM), or other volatile memories that do not last during power-off duration.

[0145] A computer program includes computer-executable instructions executed by an associated processor. The program can be stored in a ROM. The processor can perform any suitable action and processing by loading the program into a RAM.

[0146] Possible implementations of the present application can be realized by means of a program and therefore the communication device can perform any process as discussed in the foregoing embodiments. Possible implementations of the present application can also be realized in hardware or in a combination of software and hardware.

[0147] In some embodiments, the program can be tangibly embodied in a computer-readable storage medium which can include other storage devices in a device, such as in a memory, or other storage devices accessible by the device. The program can be loaded from the computer-readable storage medium into a RAM for execution. The computer-readable storage medium can include any type of tangible non-transitory memory, such as ROM, EPROM, flash memory, hard disk, CD, DVD, etc.

[0148] The embodiments of the present application also provide a computer-readable storage medium, which stores computer instructions or program codes, when the processor executes the instructions or the program codes, the processor executes the method and functions involved in any of the above embodiments. The computer-readable medium can be any tangible medium containing or storing programs for or about instruction execution systems, devices or equipment. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor system, device or equipment, or any suitable combination thereof. The computer-readable storage medium can be any available medium accessible by a computer or data storage device such as a server, data center, etc. integrated with one or more available media sets. More detailed examples of the computer-readable storage medium include electrical connections with one or more wires, magnetic media (such as a magnetic disk, a floppy disk, a hard disk, a magnetic tape, a magnetic storage device), optical media (such as an optical storage device, a DVD), semiconductor media (such as a solid-state hard disk), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), or any suitable combination thereof, etc.

[0149] In the above embodiments, all or part can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part can be implemented in the form of a computer program product. The embodiments of the present application also provide at least one computer program product tangibly stored on a non-transitory computer readable storage medium. The computer program product includes one or more computer executable instructions, such as instructions included in program modules, executed by devices at a target real or virtual processor to perform processes, methods and functions involved in any of the above embodiments. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode.

[0150] The embodiments of the present application also propose a computer program product, including computer programs or instructions, when the computer programs or instructions are run on a computer, so that the computer executes the processes, methods and functions in the above embodiments. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of the program modules can be combined or divided according to needs among the program modules. Machine executable instructions for program modules can be executed within a local or distributed device. In a distributed device, program modules can be located in local and remote storage media.

[0151] Generally, various embodiments of the present application can be implemented in hardware or special circuitry, software, logic or any combination thereof. Some aspects can be implemented in hardware, while other aspects can be implemented in firmware or software, which can be executed by a controller, microprocessor or other computing device. Although various aspects of the embodiments of the present disclosure are shown and described as block diagrams, flowcharts or using some other diagrammatic representations, it should be understood that the blocks, devices, systems, techniques or methods described herein can be implemented as, for example, hardware, software, firmware, special circuitry or logic, general purpose hardware or controller or other computing device, or some combination thereof.

[0152] It should be noted that although the embodiments of the present application are described above respectively in combination with the drawings, the above embodiments are not independent of each other, and they can be combined to obtain other embodiments. The manners, cases, categories and division of embodiments in the embodiments of the present application are only for the convenience of description, and should not constitute special limitation. The features in various manners, categories, cases and embodiments can be combined with each other as long as they are consistent with logic. The various embodiments of the present application can be combined arbitrarily to achieve different technical effects. The embodiments of the present application do not list various combinations again.

[0153] In addition, although the operations of the methods of the present disclosure are described in a particular order in the drawings, this does not require or imply that the operations must be performed in that particular order, or that all of the illustrated operations must be performed to achieve the desired results. On the contrary, the steps depicted in the flowcharts can change the order of execution. Additionally or alternatively, certain steps can be omitted, combined into one step, and / or divided into multiple steps. It should also be noted that the features and functions of two or more devices according to the present disclosure can be embodied in one device. Conversely, the features and functions of one device described above can be further divided into devices.

[0154] It should also be noted that the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed, or further include elements inherent in such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.

[0155] The above only describes the embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.

Claims

1. A business processing method, characterized in that: The service processing method is executed by a front-end processor cluster, in which multiple active front-end processor nodes are deployed, and each front-end processor node has a first consumer and a second consumer based on a message queue created therein. The service processing method includes: Processing a session connection message of the core service cluster based on the first consumer and establishing a session connection between the core service cluster and a third-party system through a target front-end processor node, where the target front-end processor node is one of the active-active front-end processor nodes; When a session connection is successfully established, a session initialization message is sent through the target front-end node. The session initialization message carries the service channel identifier and the IP address of the target front-end node, so that the service node of the core service cluster caches the service channel identifier and the IP address of the target front-end node. The second consumer receives a service message from the core service cluster and consumes the service message through the target front-end node, wherein the service message carries a tag, and the tag is set to the IP address of the target front-end node corresponding to the cached service channel identifier; The processing of the session connection message of the core service cluster based on the first consumer and establishing a session connection between the core service cluster and the third-party system through the target front-end node includes: Receive a session connection message from the core service cluster based on the subscribed connection message topic, where the session connection message carries a service channel identifier; In single certificate mode, establishing a communication connection between the front-end node and the third-party system; Determining the target front-end processor node among the multiple active front-end processor nodes based on a load balancing strategy; Based on the communication connection between the target front-end node and the third-party system, the session connection message is forwarded to the third-party system, so that the third-party system performs user identity authentication according to the session connection message.

2. The business processing method according to claim 1, characterized in that: When the session connection is successfully established, sending the session initialization message through the target front-end node includes: Receiving a session connection success message returned by the third-party system; Generate a session initialization message based on the session connection success message; The session initialization message is sent to a message queue through the target front-end node, so that a service node of a core service cluster that has subscribed to the session initialization message receives the session initialization message.

3. The business processing method according to claim 1, characterized in that: The receiving the service message of the core service cluster based on the second consumer and consuming the service message through the target front-end node includes: Receiving a service message of the core service cluster based on the service message topic subscribed by the second consumer; The target front-end node is determined based on the tag corresponding to the second consumer and the tag carried in the service message, and the service message is consumed by the target front-end node.

4. The service processing method according to any one of claims 1 to 3, characterized in that: The first consumer is created in the following way: Create an implementation class for the first message receiving and processing interface; A first annotation is added to the implementation class of the first message receiving and processing interface, where the first annotation is used to establish a corresponding consumer group and subscription connection message topic for each front-end node.

5. The business processing method according to any one of claims 1 to 3, characterized in that: The second consumer is created in the following way: Create an implementation class for the second message receiving and processing interface; Add a second annotation to the implementation class of the second message receiving and processing interface. The second annotation is used to establish corresponding consumer groups and tags for each front-end node and subscribe to business message topics. The business message topic is configured as the service name of the front-end node.

6. The business processing method according to claim 1, characterized in that: The business processing method further includes: When the session connection triggers a termination condition, a session termination message is sent to a message queue, so that a service node of a core service cluster that has subscribed to the session termination message receives the session termination message.

7. A business processing device, characterized in that: The service processing device is applied to a front-end processor cluster, wherein multiple active front-end processor nodes are deployed in the front-end processor cluster, and a first consumer and a second consumer based on a message queue are created in each front-end processor node. The service processing device includes: A first consumer unit is configured to process a session connection message of the core service cluster based on the first consumer and establish a session connection between the core service cluster and a third-party system through a target front-end processor node, where the target front-end processor node is one of the active-active front-end processor nodes; A first sending unit is configured to send, through the target front-end node, a session initialization message when a session connection is successfully established, wherein the session initialization message carries a service channel identifier and an IP address of the target front-end node, so that the service node of the core service cluster caches the service channel identifier and the IP address of the target front-end node; A second consumption unit is configured to receive a service message of the core service cluster based on the second consumer and consume the service message through the target front-end node, where the service message carries a tag, and the tag is set to the IP address of the target front-end node corresponding to the cached service channel identifier; The first consumer unit is specifically used for: Receive a session connection message from the core service cluster based on the subscribed connection message topic, where the session connection message carries a service channel identifier; In single certificate mode, establishing a communication connection between the front-end node and the third-party system; Determining the target front-end processor node among the multiple active front-end processor nodes based on a load balancing strategy; Based on the communication connection between the target front-end node and the third-party system, the session connection message is forwarded to the third-party system, so that the third-party system performs user identity authentication according to the session connection message.

8. A business system, characterized in that: The business system includes a core business cluster and a front-end cluster, and the front-end cluster is used to execute the business processing method according to any one of claims 1 to 6.

9. The business system according to claim 8, characterized in that: The core service cluster includes multiple service nodes, and the service nodes are further used to: Receive a session initialization message based on the subscription, wherein the session initialization message carries a service channel identifier and an IP address of a front-end node; The service channel identifier and the IP address of the front-end node are cached accordingly.

10. The business system according to claim 9, characterized in that: The service node is also used for: Receiving a service request and obtaining a service channel identifier according to the service request; Obtaining the IP address of the front-end node corresponding to the service channel identifier from the cache according to the service channel identifier; Encapsulating a service message according to the service request and the IP address of the front-end node; The service message is sent to a message queue whose message subject is the service name of the front-end node, and the label of the service message is set to the IP address of the front-end node.

11. A device comprising: processor; and a memory arranged to store computer-executable instructions, wherein when the executable instructions are executed, the processor executes the business processing method according to any one of claims 1 to 6.

12. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the business processing method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Message queue system, service processing method and computer readable storage medium

    CN114338063A

  • Message processing method and device under same-city multi-activity data center

    CN115480929A