Distributed message transmission method, device, equipment and medium

By enabling gateway communication and preset ports in the message service cluster to establish cross-domain gateway node connections, the problem of message transmission efficiency and reliability across multiple cloud data centers is solved, and efficient and reliable multi-cloud message delivery is achieved.

CN117411762BActive Publication Date: 2024-08-23AEROSPACE INFORMATION RES INST CAS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311395848.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-25
Publication Date
2024-08-23
Estimated Expiration
2043-10-25

AI Technical Summary

Technical Problem

Existing message transmission solutions across multiple secure and isolated cloud data centers have low performance and efficiency, and cannot guarantee reliable delivery of messages. Common solutions sacrifice transmission speed when improving reliability, cannot meet the demand for efficient transmission, and have serious waste of bandwidth resources. .

Method used

Enable gateway communication in the message service cluster and establish cross-domain connections through gateway nodes. Built-in preset ports are allowed by the firewall. Only each gateway node connects to a remote single gateway node. The asynchronous transmission method of publish and subscribe is used to optimize discovery and connection. protocol to reduce network connectivity costs.

Benefits of technology

It achieves efficient and reliable messaging between multi-cloud data centers, builds efficient super clusters, reduces the number of ports and network connections, and improves transmission performance and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117411762B
    Figure CN117411762B
Patent Text Reader

Abstract

The present disclosure provides a distributed message transmission method, including: enabling gateway communication on a message server in a message service cluster, establishing a connection between gateway nodes of cross-domain message service clusters; a preset port is built into the message server of the cross-domain message service cluster, and distributed messages are transmitted between the cross-domain message service clusters, and the preset port is allowed by the firewall; wherein, when establishing a connection between gateway nodes of the cross-domain message service cluster, each gateway node in the message service cluster is only connected to a single gateway node in the cross-domain remote message service cluster. The method has the ability to perform cross-domain transmission in a securely isolated environment, reduces the coupling degree of application software by asynchronous transmission, greatly improves transmission capacity, and has the ability to form a super cluster through a minimum network connection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of distributed computing and information transmission, and in particular to a distributed message transmission method, device, electronic device and medium. Background Art

[0002] With the development of information technology and the advent of the big data era, cloud computing and microservice frameworks have been widely adopted, and more and more companies need to rely on data interaction across multi-cloud platforms to open up their businesses, make decisions, and achieve optimization. The interaction between multi-cloud data centers and the construction of highly available, scalable, secure and effective network services have become an inevitable requirement, and cross-cloud message transmission technology has emerged.

[0003] Currently, there are few transmission solutions across multiple securely isolated cloud data centers. The common solution is to use TCP and UDP programming technology to encapsulate and transmit messages in a synchronous transmission mode, which has relatively low performance and efficiency. Most solutions cannot guarantee reliable message delivery, or sacrifice transmission speed for reliable transmission, which cannot meet the needs of efficient transmission. Some solutions build too many connections between multiple cross-data center cluster nodes, wasting precious bandwidth resources. Summary of the invention

[0004] In view of the above problems, the present invention provides a distributed message transmission method to solve the above problems.

[0005] A first aspect of the present disclosure provides a distributed message transmission method, including: enabling gateway communication on a message server in a message service cluster, and establishing a connection between gateway nodes between cross-domain message service clusters; building a preset port in the message server of the cross-domain message service cluster, and transmitting distributed messages between the cross-domain message service clusters, wherein the preset port is allowed by a firewall; wherein, when establishing a connection between the cross-domain gateway nodes of the message service cluster, each gateway node in the message service cluster is only connected to a single gateway node in the cross-domain remote message service cluster.

[0006] According to an embodiment of the present disclosure, enabling gateway communication on a message server in a message service cluster and establishing a connection between gateway nodes between cross-domain message service clusters includes: after the message server is started, detecting whether the message server is configured with a gateway port; when the message server is configured with a gateway port, starting a coroutine to detect the gateway nodes sent by other message servers in the inbound connection domain, and creating an outbound connection to the gateway node of the remote server configured in the gateway port.

[0007] According to an embodiment of the present disclosure, the method also includes: after establishing the connection of the gateway node, sending an INFO message of the message server that creates the connection to the message server that receives the gateway connection, so that the message server that receives the gateway connection adds the address and port IP fields of the message server that creates the connection; and forwarding the INFO message to other message servers through the message server that receives the gateway connection.

[0008] According to an embodiment of the present disclosure, the method further includes: after the message server receiving the gateway connection receives the INFO message, sending a CONNECT message to the message server receiving the gateway connection, the CONNECT message including the token information and security information of the gateway node.

[0009] According to an embodiment of the present disclosure, the method further includes: establishing a connection between the message server and the client through a processConnect method; starting a read loop in the message server, receiving distributed messages from the client, and forwarding the distributed messages in a message service cluster.

[0010] According to an embodiment of the present disclosure, the method also includes: based on the RS+ protocol, enabling the client of the message server to subscribe to topic messages between the gateway nodes, and maintaining the client account subscribing to each topic message through a distributed queue; wherein the account uses the queue group name of the distributed queue and the weighting factor of the topic message to start subscription to the topic message.

[0011] According to an embodiment of the present disclosure, the preset ports include port 7222 and ports 18001-18999, wherein port 7222 is used to monitor the distributed messages, and ports 18001-18999 are used to send the distributed messages, and the actual number of used preset ports = the number of domain centers + 1.

[0012] The second aspect of the present disclosure provides a distributed message transmission device, including: a cross-domain connection module, which is used to enable gateway communication on a message server in a message service cluster and establish a connection between gateway nodes between cross-domain message service clusters; a message forwarding module, which is used to build a preset port into the message server of the cross-domain message service cluster and transmit distributed messages between the cross-domain message service clusters, and the preset port is allowed by the firewall; wherein, when establishing a connection between the gateway nodes across the domain of the message service cluster, each gateway node in the message service cluster is only connected to a single gateway node in the cross-domain remote message service cluster.

[0013] The third aspect of the present disclosure provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, each step of the distributed message transmission method described in any one of the first aspects is implemented.

[0014] The fourth aspect of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, each step in any one of the distributed message transmission methods provided in the first aspect is implemented.

[0015] At least one of the above technical solutions adopted in the embodiments of the present disclosure can achieve the following beneficial effects:

[0016] The distributed message transmission method provided by the present invention is based on the asynchronous transmission mode of publish-subscribe, uses the minimum number of ports when opening cross-domain channels, and optimizes the discovery and connection protocols when using gateway nodes to build a super cluster composed of multiple clusters, so that multi-cloud data centers are built with the minimum network connection cost. Ultimately, message transmission between multiple clouds is as convenient and efficient as in one cluster. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] For a more complete understanding of the present disclosure and its advantages, reference will now be made to the following description taken in conjunction with the accompanying drawings, in which:

[0018] Figure 1 A schematic diagram schematically shows a distributed message transmission method provided by an embodiment of the present disclosure;

[0019] Figure 2 A connection flow chart of a gateway port provided by an embodiment of the present disclosure is schematically shown;

[0020] Figure 3 A schematic diagram of gateway node connection of a cross-domain cluster provided by an embodiment of the present disclosure is shown schematically;

[0021] Figure 4 A schematic diagram of a cross-domain cluster provided by an embodiment of the present disclosure is schematically shown;

[0022] Figure 5 The structure block diagram of a distributed message transmission device provided by an embodiment of the present disclosure is schematically shown;

[0023] Figure 6 The structural block diagram of an electronic device provided by an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0024] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0025] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0026] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0027] Some block diagrams and / or flow charts are shown in the accompanying drawings. It should be understood that some blocks or combinations thereof in the block diagrams and / or flow charts may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that these instructions, when executed by the processor, may create a device for implementing the functions / operations described in these block diagrams and / or flow charts.

[0028] Therefore, the technology of the present disclosure can be implemented in the form of hardware and / or software (including firmware, microcode, etc.). In addition, the technology of the present disclosure can take the form of a computer program product on a computer-readable medium storing instructions, which can be used by an instruction execution system or in combination with an instruction execution system. In the context of the present disclosure, a computer-readable medium can be any medium that can contain, store, transmit, propagate, or transmit instructions. For example, a computer-readable medium can include, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, device, or propagation medium. Specific examples of computer-readable media include: magnetic storage devices, such as magnetic tapes or hard disks (HDDs); optical storage devices, such as compact disks (CD-ROMs); memories, such as random access memories (RAMs) or flash memory; and / or wired / wireless communication links.

[0029] Figure 1 A schematic diagram of a distributed message transmission method provided by an embodiment of the present disclosure is schematically shown.

[0030] like Figure 1 As shown, an embodiment of the present disclosure provides a distributed message transmission method, including S110 to S120.

[0031] S110, enabling gateway communication on a message server in a message service cluster, and establishing a connection between gateway nodes between cross-domain message service clusters.

[0032] S120, a preset port is built into the message server of the cross-domain message service cluster, and distributed messages are transmitted between the cross-domain message service clusters, and the preset port is allowed by the firewall; wherein, when establishing a connection between the cross-domain gateway nodes of the message service cluster, each gateway node in the message service cluster is only connected to a single gateway node in the cross-domain remote message service cluster.

[0033] Specifically, a gateway is a connection channel between two domains. In this embodiment, when the message server is started, it is detected whether the message server is configured with a gateway port; when the message server is configured with a gateway port, a coroutine is started to detect the gateway node sent by other message servers in the inbound connection domain, and an outbound connection is created to the gateway node of the remote server configured in the gateway port. Among them, the connection displayed in the gateway port in the service configuration file is called outbound, and conversely, the gateway connection sent by other cluster service nodes after the service is started is called inbound.

[0034] Figure 2 A connection flow chart of a gateway port provided by an embodiment of the present disclosure is schematically shown.

[0035] like Figure 2 As shown in the figure, the main process of establishing a gateway connection includes starting the message server, checking whether the message server is configured with a gateway port, starting the gateway connection, and discovering the gateway node. Among them, starting the gateway connection includes two parts: one is to start a coroutine to detect inbound connections [startGatewayAcceptLoop]), and the other is to create an outbound connection remote server [solicitGateways]). Finally, the gateway will discover other gateway nodes and remote gateway nodes through gossip.

[0036] In this embodiment, whenever a server accepts a connection from another server, it sends information about itself and its configuration and security requirements, which is necessary for the other server to successfully authenticate and exchange messages with the server. Specifically, after establishing the connection of the gateway node, an INFO message of the message server that created the connection is sent to the message server that receives the gateway connection, so that the message server that receives the gateway connection adds the address and port IP fields of the message server that created the connection; the INFO message is forwarded to other message servers by the message server that receives the gateway connection. Any server in the cluster that receives an INFO message with an IP field will attempt to connect to the server at that address unless it is already connected. Propagating such INFO messages representing connected servers provides automatic discovery of new servers joining the cluster.

[0037] In this embodiment, the syntax of the INFO message is defined as:

[0038] INFO{["option_name":option_value],...}

[0039] The effective methods are as follows:

[0040] server_id: Unique identifier of the distributed messaging server

[0041] version: the version of the distributed message server

[0042] g0: Golang version of distributed message server

[0043] host: the host specified in the cluster parameters / options

[0044] port: The port number specified in the cluster parameters / options

[0045] auth_required: If this option is set, the server should attempt to authenticate upon connection

[0046] tls_required: If this option is set, the server must use TLS for authentication

[0047] max_payload: The maximum payload size the server will accept

[0048] connect_urls: A list of server URLs that the client can connect to

[0049] ip: The server's optional routing connection address, ms-route: / / <hostname> : <port>

[0050] Further, once the distributed message server has established a TCP / IP socket connection with another server and the INFO message has been received, the server will send a CONNECT message to provide more information about the current connection and security information. Specifically, after the message server receiving the gateway connection receives the INFO message, it sends a CONNECT message to the message server receiving the gateway connection, and the CONNECT message includes the token information and security information of the gateway node.

[0051] In this embodiment, the syntax of the CONNECT message is defined as follows:

[0052] CONNECT{[″option_name″:option_value],..}

[0053] Valid parameters are as follows:

[0054] tls_required: Indicates whether the server requires an SSL connection

[0055] auth_token: authorization token

[0056] user: the connection username (if auth_required is set)

[0057] pass: connection password (if auth_required is set)

[0058] name: The generated server name

[0059] lang: the implementation language of the server (go)

[0060] version: the version of the server

[0061] In this embodiment, after the message service is started, the processConnect method is used to establish a connection between the message server and the client, and a read loop readloop is started for each client connection to receive the distributed messages of the client. In the protocol parsing module, the processConnect method is used to process connections from clients, gateways, routes, leaf nodes, etc. The connection processing function between gateway nodes is: processGatewayConnect, which is actually very simple, that is, marking the current connection c.gw.connected = true, setting the gateway attribute of the connection to connected, and starting a ping timer after sending connect and info, which is used for health detection between gateway nodes.

[0062] In this embodiment, the subscription and publishing of messages between gateways is also based on accounts. Each account maintains a topic list. A node that is interested in a topic in another remote cluster usually sends an RS+ protocol. Based on the RS+ protocol, the client of the message server subscribes to topic messages between the gateway nodes, and the client accounts subscribing to each topic message are maintained through a distributed queue; wherein the account uses the queue group name of the distributed queue and the weighting factor of the topic message to start the subscription to the topic message, and the weighting factor can be the number of topic subscribers.

[0063] The syntax of the RS+ protocol can be defined as:

[0064] Subscribe: RS+ <account> <subject>\r

[0065] Queue subscription: RS+ <account> <subject> <queue> <weight>\r

[0066] account: The account associated with the topic interest

[0067] subject: subject

[0068] queue: optional queue group name

[0069] weight: Optional queue group weight, indicating how many interests / subscribers there are

[0070] When the server is no longer interested in a given topic, it will send an RS-protocol message by the server to unsubscribe.

[0071] The syntax of the RS-protocol can be defined as:

[0072] Subscribe: RS- <account> <subject>\r

[0073] account: The account associated with the topic interest

[0074] subject: subject

[0075] Figure 3 A schematic diagram of gateway node connection of a cross-domain cluster provided by an embodiment of the present disclosure is schematically shown.

[0076] like Figure 3 As shown in the figure, the configured connections (configured in the server configuration file) are shown in solid lines, and the discovered connections are shown in dotted lines. Gateways A and C are both discovered through gossiping, B discovers A, and A discovers C.

[0077] In this embodiment, the key point is that each node in the cluster will be connected to a single node in each remote cluster. In general cluster protocols, each node is directly connected to all other nodes. According to the method provided by this embodiment, each node in the cluster will be connected to a single node in each remote cluster, without connecting to all nodes, which greatly reduces the network connections when building a super cluster. The following figure shows the comparison of the number of connections when building a super cluster using the cluster protocol and the gateway protocol, taking 3 cluster connections as an example:

[0078] Number of nodes in the cluster Full network connectivity Connect using a gateway 1 3 6 2 15 12 3 36 18 4 66 24 5 105 30 30 4005 180

[0079] The above table is explained by taking three clusters A, B, and C with 2 nodes in each cluster as an example. Clusters A, B, and C have a total of 6 nodes, and the number of their full network connection channels is C6(2)=15. The number of channels connected using the gateway is C3(2)*2*2, where the outbound and inbound are *2, and the last 2 is the number of nodes in the cluster.

[0080] The calculation formula for the number of channels connected to the gateway can be expressed as:

[0081] CM(2)*2*N, where M is the number of clusters and N is the number of internal nodes.

[0082] When the number of nodes in a cluster increases or the number of clusters increases, the use of gateway connection method greatly reduces the number of network connections.

[0083] A core operation of cross-domain operation is to break through security isolation. When distributed messages are cross-domain, port 7222 is built in for listening to the distributed messages, and ports 18001-18999 are used to send the distributed messages. When cross-domain, the inbound and outbound rules of the firewall need to add these ports as allowed. Distributed messages minimize the number of cross-domain ports. In theory, the number of ports = the number of domain centers + 1. Distributed messages also use port detection and reuse mechanisms.

[0084] Figure 4 A schematic diagram of a cross-domain cluster provided by an embodiment of the present disclosure is schematically shown.

[0085] like Figure 4 As shown, 410, 420 and 430 represent cloud centers, 440 represents a gateway, 411 represents a message server cluster connected to the cloud center 410, 412 represents a client connected to the cloud center 410, 421 represents a message server cluster connected to the cloud center 420, 422 represents a client connected to the cloud center 420, 431 represents a message server cluster connected to the cloud center 430, and 432 represents a client connected to the cloud center 430.

[0086] After multiple cross-domain clusters form a super cluster, the communication between nodes of two clusters is the same as that within a cluster. The original reliable transmission method between distributed message clusters is also applicable to the super clusters formed by gateways.

[0087] The distributed message transmission method provided by the present invention is based on the asynchronous transmission mode of publish-subscribe, uses the minimum number of ports when opening cross-domain channels, and optimizes the discovery and connection protocols when using gateway nodes to build a super cluster composed of multiple clusters, so that multi-cloud data centers are built with the minimum network connection cost. Ultimately, message transmission between multiple clouds is as convenient and efficient as in one cluster.

[0088] Figure 5 The structural block diagram of a distributed message transmission device provided by an embodiment of the present disclosure is schematically shown.

[0089] like Figure 5 As shown, an embodiment of the present disclosure provides a distributed message transmission device, including: a cross-domain connection module 510 and a message forwarding module 520.

[0090] The cross-domain connection module 510 is used to enable gateway communication on a message server in a message service cluster and establish a connection between gateway nodes between cross-domain message service clusters;

[0091] The message forwarding module 520 is used to build a preset port into the message server of the cross-domain message service cluster to transmit distributed messages between the cross-domain message service clusters, and the preset port is allowed by the firewall; wherein, when establishing a connection between the gateway nodes across the domain of the message service cluster, each gateway node in the message service cluster is only connected to a single gateway node in the cross-domain remote message service cluster.

[0092] It is understandable that the cross-domain connection module 510 and the message forwarding module 520 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the cross-domain connection module 510 and the message forwarding module 520 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented in hardware or firmware such as any other reasonable way of integrating or encapsulating the circuit, or in a suitable combination of software, hardware and firmware. Alternatively, at least one of the cross-domain connection module 510 and the message forwarding module 520 can be at least partially implemented as a computer program module, and when the program is run by a computer, the function of the corresponding module can be executed.

[0093] Figure 6 The structural block diagram of an electronic device provided by an embodiment of the present disclosure is schematically shown.

[0094] like Figure 6 As shown, the electronic device described in this embodiment includes: the electronic device 600 includes a processor 610 and a computer readable storage medium 620. The electronic device 600 can execute the above reference Figure 1 Describes the method to achieve detection of specific operations.

[0095] Specifically, the processor 610 may include, for example, a general-purpose microprocessor, an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 610 may also include an onboard memory for cache purposes. The processor 610 may be a processor for executing reference Figure 1 The described method flow according to the embodiment of the present disclosure may be a single processing unit or multiple processing units for different actions.

[0096] Computer readable storage medium 620, for example, can be any medium capable of containing, storing, conveying, propagating or transmitting instructions. For example, readable storage media can include, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices, devices or propagation media. Specific examples of readable storage media include: magnetic storage devices, such as magnetic tapes or hard disks (HDD); optical storage devices, such as compact disks (CD-ROMs); memory, such as random access memory (RAM) or flash memory; and / or wired / wireless communication links.

[0097] The computer readable storage medium 620 may include a computer program 621, which may include code / computer executable instructions, which when executed by the processor 610 causes the processor 610 to perform, for example, the above-mentioned combination Figure 1 The described method sequences and any variations thereof.

[0098] The computer program 621 may be configured to have, for example, computer program codes including computer program modules. For example, in an exemplary embodiment, the codes in the computer program 621 may include one or more program modules, for example, including 621A, module 621B, ... It should be noted that the division method and number of modules are not fixed, and those skilled in the art may use appropriate program modules or program module combinations according to actual conditions. When these program module combinations are executed by the processor 610, the processor 610 may execute, for example, the above combination of Figure 1-2 The described method sequences and any variations thereof.

[0099] According to an embodiment of the present invention, at least one of the cross-domain connection module 510 and the message forwarding module 520 can be implemented as a reference Figure 6 The computer program modules described herein, when executed by the processor 610, can implement the corresponding operations described above.

[0100] The present disclosure also provides a computer-readable medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0101] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0102] Although the present disclosure has been shown and described with reference to specific exemplary embodiments of the present disclosure, it should be understood by those skilled in the art that various changes in form and details may be made to the present disclosure without departing from the spirit and scope of the present disclosure as defined by the appended claims and their equivalents. Therefore, the scope of the present disclosure should not be limited to the above-mentioned embodiments, but should be determined not only by the appended claims, but also by the equivalents of the appended claims.< / subject> < / account> < / weight> < / queue> < / subject> < / account> < / subject> < / account> < / port> < / hostname>

Claims

1. A distributed message transmission method, characterized in that: include: Enable gateway communication on the message server in the message service cluster and establish connections between gateway nodes between cross-domain message service clusters; A preset port is built into a message server of a cross-domain message service cluster to transmit distributed messages between the cross-domain message service clusters, and the preset port is permitted by a firewall; Wherein, when establishing the connection of the cross-domain gateway nodes of the message service cluster, each gateway node in the message service cluster is connected only to a single gateway node in the cross-domain remote message service cluster; Enabling gateway communication on a message server in a message service cluster to establish a connection between gateway nodes of cross-domain message service clusters includes: After the message server is started, detecting whether the message server is configured with a gateway port; When the message server is configured with a gateway port, a coroutine is started to detect the gateway nodes sent by other message servers in the inbound connection domain, and a gateway node of the remote server configured in the gateway port is created for outbound connection; The method further comprises: After the connection of the gateway node is established, an INFO message of the message server creating the connection is sent to the message server receiving the gateway connection, so that the message server receiving the gateway connection adds the address and port IP fields of the message server creating the connection; The INFO message is forwarded to other message servers by receiving the message server connected to the gateway.

2. The method according to claim 1, characterized in that The method further comprises: After receiving the INFO message, the message server receiving the gateway connection sends a CONNECT message to the message server receiving the gateway connection, where the CONNECT message includes the token information and security information of the gateway node.

3. The method according to claim 2, characterized in that The method further comprises: Establish a connection between the message server and the client through the processConnect method; A reading cycle is started in the message server to receive the distributed message from the client and forward the distributed message in the message service cluster.

4. The method according to claim 1, characterized in that: The method further comprises: Based on the RS+ protocol, the client of the message server subscribes to topic messages between the gateway nodes, and the client accounts subscribing to each topic message are maintained through a distributed queue; The account starts subscribing to the topic message using the queue group name of the distributed queue and the weighting factor of the topic message.

5. The method according to claim 1, characterized in that The preset ports include port 7222 and ports 18001-18999, wherein port 7222 is used to monitor the distributed messages, and ports 18001-18999 are used to send the distributed messages. The actual number of used preset ports = the number of domain centers + 1.

6. A distributed message transmission device, characterized in that: include: A cross-domain connection module is used to enable gateway communication on a message server in a message service cluster and establish a connection between gateway nodes of cross-domain message service clusters; A message forwarding module, which is used to embed a preset port in a message server of a cross-domain message service cluster, and transmit distributed messages between cross-domain message service clusters, wherein the preset port is allowed by a firewall; Wherein, when establishing the connection of the cross-domain gateway nodes of the message service cluster, each gateway node in the message service cluster is connected only to a single gateway node in the cross-domain remote message service cluster; The cross-domain connection module is used to detect whether the message server is configured with a gateway port after the message server is started; When the message server is configured with a gateway port, a coroutine is started to detect the gateway nodes sent by other message servers in the inbound connection domain, and a gateway node of the remote server configured in the gateway port is created for outbound connection; After the connection of the gateway node is established, an INFO message of the message server creating the connection is sent to the message server receiving the gateway connection, so that the message server receiving the gateway connection adds the address and port IP fields of the message server creating the connection; The INFO message is forwarded to other message servers by receiving the message server connected to the gateway.

7. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, each step of the distributed message transmission method described in any one of claims 1 to 5 is implemented.

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