Message processing method and device, computer equipment, readable storage medium and program product

By determining the target proxy node based on the preset priority policy in message processing, directly connecting to the data center where the consumer is located for message processing, the problem of low message processing efficiency in cross-data centers in traditional technology is solved, and more efficient messages are achieved Processing and response speed.

CN119211351AInactive Publication Date: 2024-12-27BEIJING PACTERA JINXIN TECH LTD

Patent Information

Application Number
CN202411287843.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In traditional technology, since the business system determines the proxy node in a randomly selected manner, the message processing efficiency across data centers is low, resulting in the message processing efficiency in the message cluster architecture across data centers.

Method used

By obtaining the data center identity and node address of the candidate proxy node, the target proxy node is determined based on the preset priority policy, and directly connect to the target proxy node of the data center where the consumer is located for message processing, avoiding the network overhead of cross-data center messaging. and connect latency and select the location relationship closest to other data centers when the target proxy node is unavailable.

Benefits of technology

Improve message processing efficiency, reduce network overhead and connection delay, and ensure fast response and processing of service messages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211351A_ABST
    Figure CN119211351A_ABST
Patent Text Reader

Abstract

The invention relates to a message processing method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where a consumer end is located; based on a preset priority strategy and a first identifier of a first data center where the consumer end is located, determining a first target identifier corresponding to the first identifier in the data center identifiers corresponding to the candidate agent nodes; determining a first target proxy node in candidate proxy nodes corresponding to the first target identifier; and performing message processing on the service message in the first target proxy node based on the node address. By adopting the method, the message processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of message middleware, and in particular to a message processing method, apparatus, computer equipment, computer-readable storage medium and computer program product. Background Art

[0002] As the business scale continues to expand, the concurrency of business systems in data centers has increased dramatically. Message centers need to be deployed in multiple centers to achieve cross-regional business message delivery and prevent performance degradation or downtime of a single message center.

[0003] In traditional technology, a complete set of cross-data center message clusters is built in multiple data centers, and network connections are set up between different data centers so that the message clusters of each data center can communicate with each other. In a message cluster, multiple data centers are included, where business systems are deployed in each data center. Users initiate business requests through terminals. When the producer or consumer of the business system needs to process business, the business system determines the proxy node connected to the business system by random selection, and routes the business message from the data center where the producer or consumer is located to different message instances (proxy nodes) in other data centers.

[0004] However, in the current traditional technology, since the business system determines the proxy node to which the business system is connected by random selection, cross-data center business processing is formed between producers and consumers, resulting in low efficiency of message processing in the cross-data center message cluster architecture. Summary of the invention

[0005] Based on this, it is necessary to provide a message processing method, apparatus, computer device, computer-readable storage medium and computer program product to address the above technical issues.

[0006] In a first aspect, the present application provides a message processing method, which is applied to a consumer side and includes:

[0007] Obtaining a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located;

[0008] Based on a preset priority strategy and a first identifier of a first data center where the consumer end is located, determining a first target identifier corresponding to the first identifier among the data center identifiers corresponding to each of the candidate proxy nodes;

[0009] Determine a first target proxy node among the candidate proxy nodes corresponding to the first target identifier;

[0010] Message processing is performed on the service message in the first target proxy node based on the node address.

[0011] In one embodiment, obtaining a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer terminal is located, includes:

[0012] Sending a query request to the authentication service component; the query request includes a message subject corresponding to the consumer end;

[0013] Receive the data center identifier and node address corresponding to each candidate proxy node corresponding to the message subject sent by the authentication service component, and determine the first identifier of the first data center where the consumer end is located according to the configuration file of the consumer end.

[0014] In one embodiment, the performing message processing on the service message in the first target proxy node based on the node address includes:

[0015] Sending a message pull request to the first target proxy node based on the node address;

[0016] Receiving the service message sent by the first target proxy node;

[0017] Each of the service messages is parsed and service processed, and a completion message is fed back to the first target proxy node.

[0018] In one of the embodiments, after sending a message pull request to the first target proxy node based on the node address, the method further includes:

[0019] If the service messages in the first target proxy nodes local to the first data center are all occupied, send a message pull request to other proxy nodes in other data centers;

[0020] Receive the service message sent by the other proxy nodes, and process the service message.

[0021] In a second aspect, the present application provides a message processing method, which is applied to a producer side and includes:

[0022] In response to a service request initiated by a user terminal, obtaining a data center identifier and a node address corresponding to each candidate proxy node, and a second identifier corresponding to a second data center where the producer terminal is located;

[0023] Based on a preset priority strategy and a second identifier corresponding to a second data center where the producer end is located, determining a second target identifier corresponding to the second identifier among the data center identifiers corresponding to each of the candidate proxy nodes;

[0024] Determine a second target proxy node among the candidate proxy nodes corresponding to the second target identifier;

[0025] A service message corresponding to the service request is sent to the second target proxy node based on the node address.

[0026] In a third aspect, the present application further provides a message processing device, which is applied to a consumer end and includes:

[0027] A first acquisition module, used to acquire a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located;

[0028] A first determination module, configured to determine, based on a preset priority strategy and a first identifier of a first data center where the consumer end is located, a first target identifier corresponding to the first identifier among identifiers of data centers corresponding to each of the candidate proxy nodes;

[0029] A second determination module, configured to determine a first target proxy node among candidate proxy nodes corresponding to the first target identifier;

[0030] A processing module is used to process the service message in the first target proxy node based on the node address.

[0031] In one embodiment, the first acquisition module is specifically used to send a query request to the authentication service component; the query request includes a message subject corresponding to the consumer end;

[0032] Receive the data center identifier and node address corresponding to each candidate proxy node corresponding to the message subject sent by the authentication service component, and determine the first identifier of the first data center where the consumer end is located according to the configuration file of the consumer end.

[0033] In one of the embodiments, the processing module is specifically used to send a message pull request to the first target proxy node based on the node address;

[0034] Receiving the service message sent by the first target proxy node;

[0035] Each of the service messages is parsed and service processed, and a completion message is fed back to the first target proxy node.

[0036] In one embodiment, the device further comprises:

[0037] A first sending module, configured to send a message pull request to other proxy nodes in other data centers if the service messages in the first target proxy nodes local to the first data center are all occupied;

[0038] The first receiving module is used to receive the service message sent by the other proxy nodes and process the service message.

[0039] In a fourth aspect, the present application further provides a message processing device, which is applied to a producer end and includes:

[0040] A second acquisition module, configured to respond to a service request initiated by a user terminal and acquire a data center identifier and a node address corresponding to each candidate proxy node, and a second identifier corresponding to a second data center where the producer terminal is located;

[0041] A third determination module is used to determine a second target identifier corresponding to the second identifier in the data center identifiers corresponding to each of the candidate proxy nodes based on a preset priority strategy and a second identifier corresponding to the second data center where the producer end is located;

[0042] A fourth determination module, configured to determine a second target proxy node from the candidate proxy nodes corresponding to the second target identifier;

[0043] The second sending module is used to send the service message corresponding to the service request to the second target proxy node based on the node address.

[0044] In a fifth aspect, the present application also provides a message processing system, the system comprising:

[0045] The producer end is used to respond to the service request initiated by the user end, obtain the data center identifier and node address corresponding to each candidate proxy node, and the second identifier corresponding to the second data center where the producer end is located; based on the preset priority strategy and the second identifier corresponding to the second data center where the producer end is located, determine the second target identifier corresponding to the second identifier in the data center identifiers corresponding to each candidate proxy node; determine the second target proxy node in the candidate proxy nodes corresponding to the second target identifier; and send the service message corresponding to the service request to the second target proxy node based on the node address;

[0046] The consumer end is used to perform business processing on the business message in the second target proxy node.

[0047] In one of the embodiments, the consumer end is further used to obtain a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located;

[0048] Based on a preset priority strategy and the first identifier, determining a first target identifier among data center identifiers corresponding to each of the candidate proxy nodes;

[0049] Determine a first target proxy node among the candidate proxy nodes corresponding to the first target identifier;

[0050] Message processing is performed on the service message in the first target proxy node based on the node address.

[0051] In one embodiment, the system further comprises:

[0052] The authentication service component is used to respond to a message processing request sent by a producer or consumer and determine a message subject corresponding to the message processing request;

[0053] Determine a candidate proxy node corresponding to the message subject in a node information table based on the message subject;

[0054] The data center identifier and the node address corresponding to the candidate proxy node are sent to the consumer end or the producer end.

[0055] In one of the embodiments, the authentication service component is further used to obtain a data center identifier and a node address of each proxy node contained in each data center;

[0056] A node information table including the proxy nodes of each of the data centers is constructed according to the data center identifier and the node address.

[0057] In a sixth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0058] Obtaining a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located;

[0059] Based on a preset priority strategy and a first identifier of a first data center where the consumer end is located, determining a first target identifier corresponding to the first identifier among the data center identifiers corresponding to each of the candidate proxy nodes;

[0060] Determine a first target proxy node among the candidate proxy nodes corresponding to the first target identifier;

[0061] Message processing is performed on the service message in the first target proxy node based on the node address.

[0062] In a seventh aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0063] Obtaining a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located;

[0064] Based on a preset priority strategy and a first identifier of a first data center where the consumer end is located, determining a first target identifier corresponding to the first identifier among the data center identifiers corresponding to each of the candidate proxy nodes;

[0065] Determine a first target proxy node among the candidate proxy nodes corresponding to the first target identifier;

[0066] Message processing is performed on the service message in the first target proxy node based on the node address.

[0067] In an eighth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0068] Obtaining a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located;

[0069] Based on a preset priority strategy and a first identifier of a first data center where the consumer end is located, determining a first target identifier corresponding to the first identifier among the data center identifiers corresponding to each of the candidate proxy nodes;

[0070] Determine a first target proxy node among the candidate proxy nodes corresponding to the first target identifier;

[0071] Message processing is performed on the service message in the first target proxy node based on the node address.

[0072] According to the above-mentioned message processing method, apparatus, computer equipment, computer-readable storage medium and computer program product, the consumer end can determine the first target proxy node locally in the data center where the consumer end is located according to the preset priority strategy through the data center identifier corresponding to each candidate proxy node and the first identifier of the first data center where the consumer end is located. Then the consumer end directly connects to the first target proxy node locally in the data center where the consumer end is located according to the node address to process the message, thereby avoiding the network overhead and connection delay of cross-data center message transmission, or selecting the first target proxy node with higher performance for connection through the preset priority strategy, and selecting other data centers that are closest in terms of location relationship for selection of the first target proxy node when the first target proxy node is unavailable, thereby improving the response speed of the consumer end to the processing of business messages, thereby improving the message processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

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

[0075] Figure 2 A schematic diagram of a flow chart of a message processing method applied to a consumer side in one embodiment;

[0076] Figure 3 A schematic diagram of a process for obtaining basis information for selecting a proxy node in one embodiment;

[0077] Figure 4 A schematic diagram of a process of processing a service message on a consumer side in one embodiment;

[0078] Figure 5 A schematic diagram of a flow chart of message processing when the first target proxy node is unavailable in one embodiment;

[0079] Figure 6 A schematic diagram of a process flow of message processing applied to a producer side in one embodiment;

[0080] Figure 7 A schematic diagram of a process of a message processing system applied to a consumer side in one embodiment;

[0081] Figure 8 is a structural block diagram of a message processing device in one embodiment;

[0082] Fig. 9 is a structural block diagram of a message processing device applied to a producer side in one embodiment;

[0083] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0084] 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.

[0085] The message method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown in FIG. 1 , in the data center, the consumer end 102 and the producer end 104 communicate with the authentication service component 106 through the network, and multiple data centers jointly deploy a set of message clusters. The consumer end 102 obtains each candidate proxy node (such as Figure 1 The consumer terminal 102 receives the data center identifier and node address corresponding to the broker shown in the figure, and the first identifier of the first data center where the consumer terminal 102 is located; the consumer terminal 102 determines the first target identifier among the data center identifiers corresponding to the candidate proxy nodes based on the preset priority strategy and the first identifier; the consumer terminal 102 determines the first target proxy node among the candidate proxy nodes corresponding to the first target identifier; the consumer terminal 102 processes the business message in the first target proxy node based on the node address. Among them, the consumer terminal and the producer terminal can be business systems deployed in the data center. For example, the producer terminal can be a front-end transaction system, and the consumer terminal corresponding to the producer terminal is a back-end transaction processing system. When deployed, the producer terminal and the consumer terminal will register with the authentication service component (such as Figure 1 The nameSever shown in the figure) is used to store the information of each proxy node.

[0086] In an exemplary embodiment, Figure 2 As shown, a message processing method is provided, which is applied to Figure 1 The consumer end in FIG. 1 is taken as an example to illustrate, and the steps include the following steps 202 to 206. Among them:

[0087] Step 202: Obtain a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located.

[0088] Among them, the nameSever (authentication service component) corresponding to each data center that constitutes the message cluster has each proxy node contained in each data center (such as Figure 1 The broker shown in the figure contains information about the data center identifier and node address corresponding to each proxy node.

[0089] In the embodiment of the present application, in the active-active scenario, Figure 1In the application scenario of the main center and the same city center shown in the figure, each data center jointly deploys a message cluster, and each data center deploys a consumer-side business system. The candidate nodes brokerM1 and brokerM2 in the main center and the candidate nodes brokerM3 and brokerM4 in the same city center are cross-backed, that is, the backup nodes of brokerM1 and brokerM2 in the main center are brokerS1 and brokerS2 in the same city center respectively; the backup nodes of brokerM3 and brokerM4 in the same city center are brokerS3 and brokerS4 in the main center respectively. In this message cluster, the consumer end monitors the message queue of the message topic to which the consumer end belongs in real time, and processes the business messages arriving in the message queue immediately. The consumer end needs to load the configuration file when it starts, and obtain the necessary configuration information by connecting to the nameSever (authentication service component) of the local data center of the consumer end, including the data center identifier corresponding to each candidate proxy node, the node address corresponding to each candidate proxy node, and the data center identifier of the first data center where the current consumer end is located, that is, the first identifier. Each data center stores the candidate proxy nodes and node addresses of all data centers, and uses the corresponding relationship between the candidate proxy nodes and the data center to which they belong as the data center identifier, such as Figure 1 As shown, the data center identifier of the candidate proxy node may represent the main center or the same city center. The first data center identifier is the data center identifier of the data center where the consumer end is located, and is used to determine the candidate proxy node contained in the data center where the consumer end is located.

[0090] Step 204 : Based on a preset priority strategy and a first identifier of a first data center where the consumer end is located, a first target identifier corresponding to the first identifier is determined from among the data center identifiers corresponding to each candidate proxy node.

[0091] In the embodiment of the present application, the preset priority strategy can be the proximity principle, that is, in the process of determining the first target proxy node to be connected, the consumer end determines the data center identifier that matches the first identifier as the first target identifier among the data center identifiers corresponding to each candidate proxy node, indicating that the consumer end screens the first target proxy node among the candidate proxy nodes contained in the data center where the consumer end is located, indicating that the consumer end in the same data center consumes the business message of the data center where the consumer end is located. If the status of all candidate proxy nodes in the data center where the consumer end is located is occupied or unavailable, the consumer end selects a data center according to the positional relationship between other data centers and the data center where the consumer end is located through the preset priority strategy, and selects other data centers that are closest to the data center corresponding to the first identifier in terms of positional relationship according to the preset priority strategy to obtain the first target identifier.

[0092] In an optional embodiment, the preset priority strategy can also be to select a data center based on the priority of other data centers and the data center where the consumer end is located. The priority can be the performance or load of the proxy node in the data center, etc. For example, the consumer end tests each data center in advance, obtains the delay of the data center at each location and the delay in performance to build a priority relationship table, and when selecting a data center, determines the data center with the best connection performance corresponding to the first data center of the first identifier according to the pre-built priority relationship table to obtain the first target identifier. If the candidate proxy nodes in the data center corresponding to the first target identifier selected by the consumer end according to the preset priority strategy are occupied or unavailable, the consumer end selects the next data center related to the first identifier in the priority relationship table according to the preset priority strategy to obtain a new first target identifier.

[0093] In a specific embodiment, the consumer starts and loads the configuration, connects to the nameServer, and requests information about all candidate proxy nodes related to the "order topic", such as Figure 1 As shown, DC1 represents the main center and DC2 represents the center in the same city. If the data center where the consumer end is located is the main center, the first identifier of the data center where the consumer end is located is "DC1", and the data center identifiers corresponding to the candidate proxy nodes obtained by the consumer end are "brokerM1, DC1", "brokerM2, DC1", "brokerS3, DC1", "brokerS4, DC1", "brokerM3, DC2", "brokerM4, DC2", "brokerS1, DC2", and "brokerS2, DC2". Then "DC1" is determined as the first target identifier, and "brokerM1", "brokerM2", "brokerS3" and "brokerS4" corresponding to "DC1" are determined as candidate proxy nodes.

[0094] Step 206: determine a first target proxy node from the candidate proxy nodes corresponding to the first target identifier.

[0095] In the embodiment of the present application, the first target identifier represents that the data center to which the candidate proxy node belongs is the data center where the current consumer terminal is located. After the consumer terminal determines the first target identifier, it can determine multiple candidate proxy nodes contained in the data center where the consumer terminal is located according to the first target identifier. Each candidate proxy node has an independent load state and health state. The consumer terminal can determine the first target proxy node among multiple candidate proxy nodes according to a preset load balancing strategy, and the consumer terminal can dynamically subscribe to different first target proxy nodes to prevent the load of a single candidate proxy node from exceeding the maximum threshold. Optionally, after determining multiple candidate proxy nodes, the consumer terminal can also select the first target proxy node with the highest priority among the current candidate proxy nodes according to the preset priority for each candidate proxy node contained in the preset priority strategy. For example, the preset priority strategy contains a performance priority table constructed according to the performance of each proxy node. After determining the candidate proxy node, the consumer terminal determines the priority of the candidate proxy node according to the performance priority table, and then determines the first target proxy node according to the priority of the candidate proxy node.

[0096] Step 208: Process the service message in the first target proxy node based on the node address.

[0097] In an embodiment of the present application, after determining the first target proxy node, the consumer side determines the node address corresponding to the first target proxy node based on the node addresses corresponding to the candidate proxy nodes fed back by the nameSever to pull the business message, obtain the business message stored in the first target proxy node, and perform business logic processing on the business message, such as order processing, data analysis, etc., and stores the data in the business message in the database and expands the update cache according to the business message after business logic processing, and updates the event identifier and index corresponding to the business message, etc., to complete the consumer side's processing of the business message.

[0098] In the above message processing method, the consumer end uses the data center identifier corresponding to each candidate proxy node and the first identifier of the first data center where the consumer end is located. The consumer end can determine the first target proxy node locally in the data center where the consumer end is located according to the preset priority strategy, and then the consumer end directly connects to the first target proxy node locally in the data center where the consumer end is located according to the node address to process the message, thereby avoiding the network overhead and connection delay of cross-data center message transmission, or selecting the first target proxy node with higher performance for connection through the preset priority strategy, and selecting other data centers that are closest in terms of location relationship for selection of the first target proxy node when the first target proxy node is unavailable, thereby improving the response speed of the consumer end to business message processing, thereby improving the message processing efficiency.

[0099] In an exemplary embodiment, Figure 3 As shown, step 202 includes steps 302 to 304. Among them:

[0100] Step 302: Send a query request to the authentication service component.

[0101] The query request includes the message topic corresponding to the consumer side.

[0102] In an embodiment of the present application, when the consumer end is started, it will connect to the authentication service component (nameSever) of the data center. Each proxy node registered in the authentication service component (nameSever) contains message correspondences for multiple different message topics. The consumer end initiates a query request to the authentication service component, requesting to query the proxy node information of the message topic that the consumer end can process.

[0103] Step 304: Receive the data center identifier and node address corresponding to each candidate proxy node corresponding to the message subject sent by the authentication service component, and determine the first identifier of the first data center where the consumer end is located according to the configuration file of the consumer end.

[0104] In the embodiment of the present application, the authentication service component (nameSever) returns a list of relevant candidate proxy nodes (brokers) according to the message subject of the query message, including the data center identifier, address and port of the data center where each candidate proxy node is located. For example, the consumer end is a business system that processes the business message of subject A. The consumer end sends a query request containing subject A to the authentication service component. The authentication service component uses the proxy node containing subject A as a candidate proxy node and feeds back the information of each candidate proxy node to the consumer end, and then the consumer end receives the data center identifier, node address and port corresponding to the candidate proxy node.

[0105] When deploying the consumer side, the data center information can be specified through a configuration file or environment variable, and each instance of the consumer side will read the configuration file at startup to determine the first data center where the consumer side is located and the first identifier corresponding to the first data center.

[0106] In this example, the data center identifier and node address of the candidate proxy node are obtained by sending a query request to the authentication service component, ensuring that the consumer side only pulls business messages from candidate proxy nodes that are meaningful to it, thereby improving the accuracy of message processing, reducing network communication overhead, and improving the efficiency of business message processing.

[0107] In an exemplary embodiment, Figure 4 As shown, step 208 includes steps 402 to 406. Among them:

[0108] Step 402: Send a message pull request to the first target proxy node based on the node address.

[0109] In an embodiment of the present application, first, the consumer side uses the address information of the first target proxy node obtained from the authentication service component to construct a message pull request, which includes necessary parameters such as the message subject that the consumer needs to pull, the starting position or offset of the pull, and the like, and sends the message pull request to the first target proxy node through the address information. The message pull request can be an HTTP (Hypertext Transfer Protocol) request, a TCP (Transmission Control Protocol) or IP (Internet Protocol) data packet, or a request format for pulling messages defined in other protocols.

[0110] Step 404: Receive a service message sent by the first target proxy node.

[0111] In an embodiment of the present application, the consumer end receives a business message sent from the first target proxy node. The business message may be a message set, including multiple business messages stored in a message queue of a certain message topic in the first target proxy node, and each business message includes business data and related metadata.

[0112] Step 406: parse and process each service message, and feed back a completion message to the first target proxy node.

[0113] In the embodiment of the present application, the consumer side parses the received business message according to the predefined message format or protocol, including decoding the message content and extracting the message body, message header and other parsing operations, as well as extracting the data field of the message content and performing data conversion operations, etc. The consumer side performs business logic processing according to the parsed message content, for example, processing orders, updating user information, or performing data analysis and statistics, etc.

[0114] After the consumer completes the business processing of the business message, it feeds back the completion message of the business message to the first target proxy node, and confirms the processing status of the current business message to the first target proxy node. Then the first target proxy node can remove the processed business message from the message queue to prevent the risk of subsequent repeated consumption.

[0115] In this example, by feeding back the processing results of the business message to the first target proxy node, the consumer side ensures that each message is processed correctly and avoids repeated or missed processing. By directly sending a pull request to the first target proxy node, the consumer side can quickly obtain the business message that needs to be consumed, reducing the intermediate links and reducing the delay in message processing.

[0116] In an exemplary embodiment, after the consumer sends a pull request to the first target proxy node, the first target proxy node may have an abnormal situation. At this time, the message processing of the consumer needs to be adjusted accordingly, such as Figure 5 As shown, after step 402, the method further includes steps 502 to 504. Among them:

[0117] Step 502: If the business messages in the first target proxy nodes in the first data center are all occupied, a message pull request is sent to other proxy nodes in other data centers.

[0118] In an embodiment of the present application, after the consumer end sends a message pull request to the first target proxy node, if the business message of the first target proxy node is occupied, the consumer end sends message pull requests to other first target proxy nodes corresponding to the first identifier of the first data center in sequence according to the order of the load balancing mechanism. If the business messages in the first target proxy nodes local to the first data center are all occupied, the consumer end can determine other data centers according to a preset priority strategy, for example, select other data centers according to the geographical location of the data center and the distance between the location of the data center where the consumer end is located. Then, the consumer end sends message pull requests to other proxy nodes in other data centers, trying to obtain Huqiu business messages from other proxy nodes.

[0119] Step 504: Receive business messages sent by other proxy nodes and process the business messages.

[0120] In the embodiment of the present application, after the consumer end receives other to-be-processed messages sent by other proxy nodes, it processes the business messages sent by other proxy nodes according to the same principle as step 406. The detailed process of the business messages will not be repeated in this embodiment.

[0121] In this example, by checking the status of the first target proxy node in the local data center and initiating requests to the proxy nodes in other data centers, the consumer side can increase the chances of obtaining messages to be processed, avoiding the impact of insufficient resources of the first target proxy node in the local data center on message processing. By pulling business messages across data centers, it is possible to automatically switch to other data centers for message processing when resources in one data center are tight, thereby improving the reliability of message processing.

[0122] In an exemplary embodiment, Figure 6 As shown, a message processing method is provided, which is applied to Figure 1 The producer side in is taken as an example to illustrate, including the following steps 602 to 608. Among them:

[0123] Step 602, in response to a service request initiated by the user end, obtain a data center identifier and a node address corresponding to each candidate proxy node, and a second identifier corresponding to a second data center where the producer end is located.

[0124] In an embodiment of the present application, the producer side may be a business system that interacts with a user terminal, such as an order system or a front-end transaction system. The producer side responds to a business request initiated by a user, generates a business message corresponding to the business request, and initiates a query request to the authentication service component (nameSever), and obtains information on multiple candidate proxy nodes corresponding to the message subject of the producer side according to the feedback of the authentication service component, including the data center identifier and node information corresponding to the candidate proxy node. At the same time, the producer side obtains the second identifier of the second data center where the producer side is located according to the configuration file at the time of deployment. Among them, if the producer side and the consumer side are in the same data center, the second data center where the producer side is located and the first data center where the consumer side is located are in the same data center, and thus, the second identifier is also the same as the first identifier.

[0125] Step 604, based on the preset priority strategy and the second identifier corresponding to the second data center where the producer end is located, determine the second target identifier corresponding to the second identifier in the data center identifiers corresponding to each candidate proxy node.

[0126] In an embodiment of the present application, the producer side determines the second target identifier that matches the second identifier in each candidate proxy node according to the preset priority strategy and the same principle as in step 204, so that the producer side sends the business message to the second data center where the producer side is located, thereby avoiding cross-data center business message transmission.

[0127] Step 606: determine a second target proxy node from the candidate proxy nodes corresponding to the second target identifier.

[0128] In an embodiment of the present application, after determining the second target identifier, the producer side determines a candidate proxy node whose data center identifier matches the second target identifier among multiple candidate proxy nodes, and determines the second target proxy node among the candidate proxy nodes whose data center identifier matches the second target identifier based on a pre-set load balancing strategy to send a business message.

[0129] Step 608: Send a service message corresponding to the service request to the second target proxy node based on the node address.

[0130] In the embodiment of the present application, the producer side sends the service request to the second target proxy node based on the node address according to the same principle as step 206, and the detailed sending process of the service message is not repeated in this embodiment. When the second target proxy node receives the service message sent by the producer side, it stores the service message, such as Figure 1 As shown, data is synchronized with other data centers in the message cluster, that is, business messages are synchronized to the proxy nodes of other data centers.

[0131] In the above message processing method, the producer side uses the data center identifier corresponding to each candidate proxy node and the second identifier of the second data center where the producer side is located. The producer side can determine the second target proxy node locally in the data center where the producer side is located according to the preset priority strategy. Then the producer side directly connects to the second target proxy node locally in the data center where the producer side is located according to the node address, and sends the business message to the second target proxy node for storage, avoiding the network overhead and connection delay of cross-data center message transmission, improving the efficiency of the producer side in delivering business messages, and thus improving the message processing efficiency.

[0132] In an exemplary embodiment, Figure 7 As shown, a message processing system 700 is provided. The message processing system includes a producer end 701 and a consumer end 702, wherein:

[0133] The producer end 701 is used to respond to the service request initiated by the user end, obtain the data center identifier and node address corresponding to each candidate proxy node, and the second identifier corresponding to the second data center where the producer end is located; based on the preset priority strategy and the second identifier corresponding to the second data center where the producer end is located, determine the second target identifier corresponding to the second identifier in the data center identifier corresponding to each candidate proxy node; determine the second target proxy node in the candidate proxy nodes corresponding to the second target identifier; and send the service message corresponding to the service request to the second target proxy node based on the node address;

[0134] The consumer end 702 is used to perform business processing on the business message in the second target proxy node.

[0135] In a specific embodiment, the consumer side is a points business system, and the producer side is an order system. When the user completes the order in the order system, the DNS (Domain Name System) routes the order request to the second data center closest to the user's location based on the user's geographical location according to the DNS load balancing technology, and processes the order through the order system in the second data center. At the same time, the order system calculates the points change corresponding to the user according to the order and generates a points message as a business message, and sends a query request to the authentication service component (nameSever) in the second data center. The order system obtains the data center identifier and node address corresponding to each candidate proxy node and the second identifier corresponding to the second data center where the producer side is located according to the feedback of the authentication service component. The order system determines the second target identifier whose data center identifier is the second identifier in each subsequent proxy node, and then determines the second target proxy node in the candidate proxy node whose data center identifier is the second target identifier, and sends the points message to the second target proxy node.

[0136] As the consumer, the points system obtains the information of the candidate proxy nodes from the nameServer of the second data center. The points system will also give priority to selecting the second target proxy node from the candidate proxy nodes in this data center for message consumption.

[0137] In an exemplary embodiment, the consumer end 701 in the message processing system 700 is further used to obtain a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located;

[0138] Based on the preset priority strategy and the first identifier, determine the first target identifier among the data center identifiers corresponding to each candidate proxy node;

[0139] Determine a first target proxy node among candidate proxy nodes corresponding to the first target identifier;

[0140] The service message in the first target proxy node is processed based on the node address.

[0141] In an exemplary embodiment, the message processing system 700 further includes:

[0142] The authentication service component is used to respond to the message processing request sent by the producer or consumer end and determine the message subject corresponding to the message processing request;

[0143] Determine a candidate proxy node corresponding to the message subject in the node information table based on the message subject;

[0144] The data center identifier and node address corresponding to the candidate proxy node are sent to the consumer or producer.

[0145] The node information table contains the mapping relationship between different message topics and proxy nodes.

[0146] In the embodiment of the present application, the authentication service component (nameSever) is used to receive a message processing request from a producer or consumer, and the request includes a message subject to be processed. The authentication service component determines the message subject corresponding to the message processing request based on the received request, searches the node information table through the message subject, determines the candidate proxy node related to the message processing request based on the message subject, and sends the relevant information of the determined candidate proxy node, including the data center identifier and the node address, to the producer or consumer.

[0147] In this example, the business system only needs to configure a set of message cluster addresses (the addresses of the authentication service components). The authentication service components are responsible for dynamically finding and providing detailed proxy node information. When a data center fails, the authentication service components can quickly reroute messages to other healthy proxy nodes, reducing the complexity of fault switching. The data center identifier corresponding to the candidate proxy node in the node information table is sent to the consumer or producer end, so that the consumer or producer end can identify the candidate proxy node in the local data center, and then process the business message at the candidate proxy node in the local data center, avoiding the network overhead and connection delay of cross-data center message transmission, improving the efficiency of the producer end in transmitting business messages, and thus improving the message processing efficiency.

[0148] In an exemplary embodiment, the authentication service component in the message processing system 700 is further used to obtain the data center identifier and node address of each proxy node contained in each data center;

[0149] A node information table containing proxy nodes of each data center is constructed according to the data center identifier and the node address.

[0150] In an embodiment of the present application, the proxy node of each data center in the message cluster is registered with the authentication service component (nameSever) of the local data center and the authentication service components (name) of other data centers at the same time when deployed. The authentication service component collects the data center identifiers and node addresses corresponding to each proxy component based on the information registered by the proxy node to the authentication service component, and builds a node information table containing the proxy nodes of each data center based on the data center identifiers and node addresses corresponding to each proxy component, so that when the business system accesses the message cluster, it only needs to set a set of addresses of the authentication service components (nameSever) that represent the message cluster. For example, the authentication service component detects that a data center is unavailable or down, and the authentication service component uses the node information table to automatically redirect messages originally routed to the faulty data center to other healthy data centers, and the business system does not need to perform any manual switching or restart operations.

[0151] In this example, when the business system accesses the message cluster, it only needs to set a set of message cluster addresses, and when a single data center fails, there is no need to switch the data source address of the message cluster, which reduces the complexity of fault switching. When a message cluster in a single data center fails, there is no need to restart the business system, thereby improving business continuity.

[0152] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0153] Based on the same inventive concept, the embodiment of the present application also provides a message processing device for implementing the message processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more message processing device embodiments provided below can refer to the limitations on the message processing method above, and will not be repeated here.

[0154] In an exemplary embodiment, Figure 8As shown, a message processing device 800 is provided, which is applied to a consumer end and includes: a first acquisition module 801, a first determination module 802, a second determination module 803 and a processing module 804, wherein:

[0155] The first acquisition module 801 is used to obtain the data center identifier and node address corresponding to each candidate proxy node, and the first identifier of the first data center where the consumer end is located;

[0156] A first determination module 802 is used to determine a first target identifier corresponding to the first identifier among the data center identifiers corresponding to the candidate proxy nodes based on a preset priority strategy and a first identifier of the first data center where the consumer end is located;

[0157] A second determination module 803 is used to determine a first target proxy node among candidate proxy nodes corresponding to the first target identifier;

[0158] The processing module 804 is used to process the service message in the first target proxy node based on the node address.

[0159] In one embodiment, the first acquisition module 801 is specifically used to send a query request to the authentication service component; the query request includes a message subject corresponding to the consumer end;

[0160] Receive the data center identifier and node address corresponding to each candidate proxy node corresponding to the message subject sent by the authentication service component, and determine the first identifier of the first data center where the consumer end is located according to the configuration file of the consumer end.

[0161] In one of the embodiments, the processing module 804 is specifically configured to send a message pull request to the first target proxy node based on the node address;

[0162] Receiving a service message sent by the first target proxy node;

[0163] Each business message is parsed and processed, and a completion message is fed back to the first target proxy node.

[0164] In one embodiment, the apparatus 800 further includes:

[0165] A first sending module, configured to send a message pull request to other proxy nodes in other data centers if all business messages in the first target proxy nodes local to the first data center are occupied;

[0166] The first receiving module is used to receive business messages sent by other proxy nodes and process the business messages.

[0167] In an exemplary embodiment, Fig. 9As shown, a message processing device 900 is provided, which is applied to the producer side and includes: a second acquisition module 901, a third determination module 902, a fourth determination module 903 and a second sending module 904, wherein:

[0168] The second acquisition module 901 is used to respond to the service request initiated by the user end and obtain the data center identifier and node address corresponding to each candidate proxy node, and the second identifier corresponding to the second data center where the producer end is located;

[0169] A third determination module 902 is used to determine a second target identifier corresponding to the second identifier in the data center identifiers corresponding to each candidate proxy node based on a preset priority strategy and a second identifier corresponding to the second data center where the producer end is located;

[0170] A fourth determination module 903 is used to determine a second target proxy node from candidate proxy nodes corresponding to the second target identifier;

[0171] The second sending module 904 is configured to send a service message corresponding to the service request to the second target proxy node based on the node address.

[0172] Each module in the above message processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0173] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. 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 database of the computer device is used to store business message data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication 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 processing method is implemented.

[0174] Those skilled in the art will understand that Fig.10The 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.

[0175] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0176] Obtaining a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located;

[0177] Based on a preset priority strategy and a first identifier of a first data center where the consumer end is located, determining a first target identifier corresponding to the first identifier among the data center identifiers corresponding to each candidate proxy node;

[0178] Determine a first target proxy node among candidate proxy nodes corresponding to the first target identifier;

[0179] The service message in the first target proxy node is processed based on the node address.

[0180] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0181] Send a query request to the authentication service component; the query request contains the message subject corresponding to the consumer side;

[0182] Receive the data center identifier and node address corresponding to each candidate proxy node corresponding to the message subject sent by the authentication service component, and determine the first identifier of the first data center where the consumer end is located according to the configuration file of the consumer end.

[0183] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0184] Send a message pull request to the first target proxy node based on the node address;

[0185] Receiving a service message sent by the first target proxy node;

[0186] Each business message is parsed and processed, and a completion message is fed back to the first target proxy node.

[0187] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0188] If the business messages in the first target proxy nodes in the first data center are all occupied, a message pull request is sent to other proxy nodes in other data centers;

[0189] Receive business messages sent by other proxy nodes and process business messages.

[0190] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0191] In response to a service request initiated by a user terminal, obtain a data center identifier and a node address corresponding to each candidate proxy node, and a second identifier corresponding to a second data center where the producer terminal is located;

[0192] Based on the preset priority strategy and the second identifier corresponding to the second data center where the producer end is located, determine the second target identifier corresponding to the second identifier in the data center identifiers corresponding to each candidate proxy node;

[0193] Determine a second target proxy node among the candidate proxy nodes corresponding to the second target identifier;

[0194] A service message corresponding to the service request is sent to the second target proxy node based on the node address.

[0195] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0196] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0197] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0198] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method 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-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0199] 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 application.

[0200] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications 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 present application shall be subject to the attached claims.

Claims

1. A message processing method, characterized in that: The method is applied to the consumer side, and the method comprises: Obtaining a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located; Based on a preset priority strategy and a first identifier of a first data center where the consumer end is located, determining a first target identifier corresponding to the first identifier among the data center identifiers corresponding to each of the candidate proxy nodes; Determine a first target proxy node among the candidate proxy nodes corresponding to the first target identifier; Message processing is performed on the service message in the first target proxy node based on the node address.

2. The method according to claim 1, characterized in that The obtaining of the data center identifier and the node address corresponding to each candidate proxy node and the first identifier of the first data center where the consumer end is located includes: Sending a query request to the authentication service component; the query request includes a message subject corresponding to the consumer end; Receive the data center identifier and node address corresponding to each candidate proxy node corresponding to the message subject sent by the authentication service component, and determine the first identifier of the first data center where the consumer end is located according to the configuration file of the consumer end.

3. The method according to claim 1, characterized in that: The performing message processing on the service message in the first target proxy node based on the node address includes: Sending a message pull request to the first target proxy node based on the node address; Receiving the service message sent by the first target proxy node; Each of the service messages is parsed and service processed, and a completion message is fed back to the first target proxy node.

4. The method according to claim 3, characterized in that After sending a message pull request to the first target proxy node based on the node address, the method further includes: If the service messages in the first target proxy nodes local to the first data center are all occupied, send a message pull request to other proxy nodes in other data centers; Receive the service message sent by the other proxy nodes, and process the service message.

5. A message processing method, characterized in that: The method is applied to the producer side, and the method includes: In response to a service request initiated by a user terminal, obtaining a data center identifier and a node address corresponding to each candidate proxy node, and a second identifier corresponding to a second data center where the producer terminal is located; Based on a preset priority strategy and a second identifier corresponding to a second data center where the producer end is located, determining a second target identifier corresponding to the second identifier among the data center identifiers corresponding to each of the candidate proxy nodes; Determine a second target proxy node among the candidate proxy nodes corresponding to the second target identifier; A service message corresponding to the service request is sent to the second target proxy node based on the node address.

6. A message processing system, characterized in that: The system comprises: The producer end is used to respond to the service request initiated by the user end, obtain the data center identifier and node address corresponding to each candidate proxy node, and the second identifier corresponding to the second data center where the producer end is located; based on the preset priority strategy and the second identifier corresponding to the second data center where the producer end is located, determine the second target identifier corresponding to the second identifier in the data center identifiers corresponding to each candidate proxy node; determine the second target proxy node in the candidate proxy nodes corresponding to the second target identifier; and send the service message corresponding to the service request to the second target proxy node based on the node address; The consumer end is used to perform business processing on the business message in the second target proxy node.

7. The system according to claim 6, characterized in that The consumer end is also used to obtain a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located; Based on a preset priority strategy and the first identifier, determining a first target identifier among the data center identifiers corresponding to each of the candidate proxy nodes; Determine a first target proxy node among the candidate proxy nodes corresponding to the first target identifier; Message processing is performed on the service message in the first target proxy node based on the node address.

8. The system according to claim 6, characterized in that The system further comprises: The authentication service component is used to respond to a message processing request sent by a producer or consumer and determine a message subject corresponding to the message processing request; Determine a candidate proxy node corresponding to the message subject in a node information table based on the message subject; The data center identifier and the node address corresponding to the candidate proxy node are sent to the consumer end or the producer end.

9. The system according to claim 8, characterized in that The authentication service component is also used to obtain the data center identifier and node address of each proxy node contained in each data center; A node information table including the proxy nodes of each of the data centers is constructed according to the data center identifier and the node address.

10. A message processing device, characterized in that: The device is applied to a consumer end, and comprises: A first acquisition module, used to acquire a data center identifier and a node address corresponding to each candidate proxy node, and a first identifier of a first data center where the consumer end is located; A first determination module, configured to determine, based on a preset priority strategy and a first identifier of a first data center where the consumer end is located, a first target identifier corresponding to the first identifier among the data center identifiers corresponding to each of the candidate proxy nodes; A second determination module, configured to determine a first target proxy node among candidate proxy nodes corresponding to the first target identifier; A processing module is used to process the service message in the first target proxy node based on the node address.

Citation Information

Patent Citations

  • Message processing system, method and device, equipment and computer readable storage medium

    CN112804332A

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

    CN115480929A

  • Message forwarding method, device and system and computer readable storage medium

    CN115695561A

  • Message publishing method, consumption method, processing method and related products

    CN118381776A

  • Optimizing selection of zero trust network access cloud edge nodes for internal application delivery

    US20230421471A1

Cited By

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

    CN119967060A