A message transmission method, system, device and storage medium
By using message identification information parsing and scheduling in a cross-regional distributed message transmission system, the problem of cross-border transmission that existing technologies cannot solve is solved, and efficient and accurate cross-regional message transmission is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-10
- Publication Date
- 2026-03-27
AI Technical Summary
Existing message queue products cannot support cross-border message transmission and cannot transmit messages between different countries.
A message transmission system is provided, comprising multiple first-type nodes distributed across regions, in a network environment isolated from each other, and cross-regional message transmission is achieved by parsing message identification information.
It enables cross-regional message transmission, avoids the limitations of the network environment, and improves the efficiency and accuracy of message transmission.
Smart Images

Figure CN116170757B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of message transmission, and in particular to a message transmission method, system, device and storage medium. BACKGROUND
[0002] Existing message queue products can usually only support message transmission needs occurring within a country, that is, messages can only be transmitted within the country and cannot be transmitted across borders. For example, existing message queue products can support message transmission within China, but cannot support message transmission to other countries.
[0003] However, more and more application scenarios have emerged that require cross-border message transmission, and therefore, there is an urgent need for a solution that can support cross-border message transmission. SUMMARY
[0004] Aspects of the present application provide a message transmission method, system, device and storage medium to realize cross-region message transmission.
[0005] The present application provides a message transmission system, comprising a plurality of first type nodes distributed across regions, wherein the network environments of different regions are isolated from each other;
[0006] The first type node in any region is configured to, after receiving a message to be transmitted, parse target message identification information corresponding to the message; if there is a first type node in another region that subscribes to the target message identification information, the message is transmitted to the first type node in the other region;
[0007] The first type node in the other region is configured to continue transmitting the message so that the message reaches a message receiving end that subscribes to the target message identification information.
[0008] In the plurality of regions, the first type nodes subscribe to message identification information subscribed by each message receiving end associated therewith.
[0009] The present application also provides a message transmission method, which is applicable to a first type node in any region of a plurality of first type nodes distributed across regions, wherein the network environments of different regions are isolated from each other, and the method comprises:
[0010] After receiving a message to be transmitted, the message identification information corresponding to the message is parsed;
[0011] If there is a first type node in another region that has subscribed to the target message identification information, the message is transmitted to the first type node in the other region for continued transmission so that the message reaches a message receiving end that has subscribed to the message identification information.
[0012] The first type node in the plurality of regions subscribes to message identification information subscribed by each message receiving end associated with the first type node.
[0013] The embodiment of the present application also provides a message transmission method, which is applicable to any second type node in a message transmission system, the message transmission system also comprising a plurality of first type nodes distributed across regions, network environments of different regions being isolated from each other, and the method comprising the following steps:
[0014] After receiving a message to be transmitted, message identification information corresponding to the message is parsed;
[0015] If it is determined that the second type node does not subscribe to the message identification information, the message is transmitted to the first type node connected to the second type node, so as to continue to transmit the message through the first type node;
[0016] The second type node subscribes to message identification information subscribed by each message receiving end connected to the second type node, and the first type node supports transmitting a received message across regions to other first type nodes or to other second type nodes connected to the first type node.
[0017] The embodiment of the present application also provides a message transmission device, comprising a memory, a processor and a communication component; the memory is used for storing one or more computer instructions; the processor is coupled with the memory and the communication component, and executes the one or more computer instructions, so as to execute the message transmission method.
[0018] The embodiment of the present application also provides a computer readable storage medium storing computer instructions, when the computer instructions are executed by one or more processors, the one or more processors execute the message transmission method.
[0019] In the embodiment of the present application, a new message transmission system is provided, which comprises a plurality of first type nodes distributed across regions, network environments of different regions being isolated from each other, and the plurality of first type nodes can synchronize message identification information subscribed by each first type node. Based on this, for any first type node in any region, after receiving a message to be transmitted, message identification information corresponding to the message can be parsed, and if there is a first type node in another region that has subscribed to the parsed message identification information, the message can be transmitted to the corresponding first type node. Accordingly, in the embodiment of the present application, based on the message scheduling capability of the first type node and the cross-region distribution attribute between the first type nodes, cross-region message transmission can be realized, and the network environment is no longer limited. BRIEF DESCRIPTION OF DRAWINGS
[0020] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0021] Figure 1 A structural schematic diagram of a message transmission system according to an example embodiment of the present application;
[0022] Figure 2 A structural schematic diagram of another message transmission system according to an example embodiment of the present application;
[0023] Figure 3 An example structural diagram of a sending queue according to an example embodiment of the present application;
[0024] Figure 4 A logic schematic diagram of a solution corresponding to application scenario 1 according to an example embodiment of the present application;
[0025] Figure 5 A logic schematic diagram of a solution corresponding to application scenario 2 according to an example embodiment of the present application;
[0026] Figure 6 A logic schematic diagram of a solution corresponding to application scenario 3 according to an example embodiment of the present application;
[0027] Figure 7 A flow schematic diagram of a message transmission method according to another example embodiment of the present application;
[0028] Figure 8 A flow schematic diagram of another message transmission method according to another example embodiment of the present application;
[0029] Figure 9 A structural schematic diagram of a message transmission device according to yet another example embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described below in conjunction with the example embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without any creative work fall within the scope of protection of the present application.
[0031] Currently, the existing message queue products cannot support cross-border transmission of messages. To this end, in some embodiments of the present application: a new message transmission system is provided, which includes a plurality of first type nodes distributed across regions, the network environments of different regions are isolated from each other, the plurality of first type nodes can synchronize the message identification information subscribed by each other, and based on this, for any first type node in any region, after receiving a message to be transmitted, the message identification information corresponding to the message can be parsed, and if there is a first type node in other regions that has subscribed to the parsed message identification information, the message can be transmitted to the corresponding first type node. Accordingly, in the embodiments of the present application, the message transmission across regions can be realized based on the message scheduling capability of the first type nodes and the cross-regional distribution attribute between the first type nodes, and is no longer limited by the network environment.
[0032] Figure 1 A structural diagram of a message transmission system according to an exemplary embodiment of the present application is provided. As shown in the figure, the system can include a plurality of first type nodes distributed across regions. Figure 1
[0033] Among them, the cross-regional distribution means that the plurality of first type nodes are distributed in a plurality of regions, the region in the embodiment means a physical region, and the network environments between different regions are isolated from each other. Generally, different regions with isolated network environments cannot transmit messages between each other, therefore, in the embodiment, the first type nodes are deployed in different regions and connected between the first type nodes, which provides a physical basis for the message transmission scheme across regions in the embodiment. In the embodiment, any two first type nodes are directly connected, of course, part of the first type nodes can be directly connected as needed, the first type nodes with network interconnection can directly communicate, and the first type nodes without network interconnection can not communicate. Among them, the network connection between the first type nodes can be realized by laying physical cables, of course, the embodiment is not limited thereto.
[0034] In the embodiments of the present application, the deployment position of the first type node in each region is not limited. In an optional embodiment, a central cluster and an edge cluster are deployed in each region, and the central cluster and the edge cluster are relative concepts. For a region, the edge cluster is relatively close or close to the message receiving end or the message source end in position, and the central cluster is relatively far from the message receiving end or the message source end in position. In this case, the first type node can be deployed in the central cluster corresponding to the region, and the first type node can be implemented as a single cloud server or a collection of multiple cloud servers. The central cluster can be a data center, which is usually large in scale, and the edge cluster can be a computer room close to the end side, which is usually small in scale and widely distributed. At present, a large number of central clusters are distributed worldwide, and correspondingly, a large number of regions involved in these central clusters are also distributed worldwide, and many regions are cross-border. In this way, in the embodiments, suitable regions in different borders can be selected for deployment of the first type node, and one or more first type nodes can be deployed in a single border. For example, in China, the first type node can be deployed in the North China (Beijing) region, the South China (Shenzhen) region, and the East China (Shanghai) region, respectively; in the United States, only the New York region can be deployed with the first type node, and in Germany, only the Frankfurt region can be deployed with the first type node. In addition, considering the large number of central clusters worldwide, in the embodiments, some popular regions can be selected according to the actual message traffic in the central clusters for deployment of the first type node. In the embodiments, the number of first type nodes can be expanded as needed.
[0035] For the above-mentioned design concept of deploying the first type node in multiple regions in a single border, the message transmission pressure in a single border can be dispersed to multiple first type nodes for execution. This decentralized design concept can perform message transmission in regions closer to the message source end or the message receiving end, thereby improving the message transmission efficiency.
[0036] The message transmission system provided in the embodiments involves not only the first type node but also the message source end and the message receiving end. The message source end is the message producer, and the message receiving end is the message consumer. The message source end can access the message transmission system provided in the embodiments, and the message transmission system can transmit the message produced by the message source end to the related message receiving end. The message in the embodiments is the carrier of data, and the type of data carried by the message is not limited in the embodiments.
[0037] In the embodiments, the processing logic on each first type node is consistent. In order to more clearly describe the technical solutions, in the embodiments, the first type node in any region will be taken as an example for solution description, and it should be understood that the first type node in any region can be any one of the multiple first type nodes.
[0038] Reference Figure 1 In this embodiment, the first type node in any region can parse the target message identification information corresponding to the message after receiving the message to be transmitted. The message identification information is usually carried in the header field of the message, and the first type node in any region can extract the message identification information from the header field of the message. The message identification information can be used to identify the classification information corresponding to the message, wherein the dimensions of the classification can include but are not limited to application program dimension, message topic (Topic) dimension, etc. The message receiving end can obtain the message under the corresponding classification by subscribing to the message identification information. In addition, it is worth noting that the message can be directly transmitted to the first type node by the message source end accessing the first type node, of course, it can also be forwarded to the first type node after the message is produced by the message source end and through other transit links (this case will be described in detail later), this embodiment does not limit the way the message reaches the first type node; no matter which way it reaches, the first type node will be uniformly processed according to the subsequent logic.
[0039] In this embodiment, the first type nodes can synchronize the message identification information each subscribed to each other, so that a single first type node can know the message identification information each subscribed to by itself and other first type nodes. Among them, the message identification information each subscribed to by a single first type node is subscribed to by each message receiving end associated with it. The association here can include two cases: one is that the message receiving end accesses the first type node, that is, the message receiving end directly obtains the message in the first type node; the other is that the message receiving end indirectly obtains the message in the first type node through other transit links (this case will be described in detail later). In this embodiment, the message receiving end involved in the above two cases can be regarded as the message receiving end associated with the first type node. It is worth noting that the message receiving end mentioned in the context obtains the message, which can be that the message receiving end actively pulls the message, or the first type node or the second type node mentioned later actively pushes the message to the message receiving end.
[0040] In this embodiment, the message transmission system can support at least two typical message transmission modes: point-to-point transmission mode and publish-subscribe transmission mode. The transmission logic of these two message transmission modes is relatively conventional, and thus will not be described in detail herein. In this embodiment, considering that the classification dimensions adopted in different message transmission modes are different, different message identification information can be designed for different message transmission modes. For the point-to-point transmission mode, the message identification information can be designed as the application program identification information corresponding to the message source end; and for the publish-subscribe transmission mode, the message identification information can be designed as the message topic identification information corresponding to the message source end. It should be noted that in this embodiment, the message topic identification information in the publish-subscribe transmission mode is improved: the message topic identification information can include the application program name and the message topic name corresponding to the message source end. In this way, there will be no same message topic identification information between different message source ends, so that message isolation between different message source ends can be realized in the publish-subscribe transmission mode, and the situation that the messages of multiple message source ends are mixed and placed in the sending queue corresponding to the same message topic no longer occurs. Based on this design of message identification information, message isolation at the application program granularity can be realized in this embodiment. It should be understood that the message source end and the message receiving end in this embodiment can both be an application program, and for an application program, it can act as a message source end or a message receiving end. The application program described in this embodiment refers to an application program running in a cloud server or other private server.
[0041] For example, the message receiving end A can subscribe to the message topic identification information APP0, TOPIC0+APP1 and TOPIC0+APP2, and thus the message receiving end A can obtain all the messages produced by APP0, the messages under TOPIC0 produced by APP1, and the messages under TOPIC0 produced by APP2. Correspondingly, the message source end can carry the message identification information adapted to the selected message transmission mode in the produced message.
[0042] Of course, in addition to the several exemplary message identification information mentioned above, more types of message identification information can be provided according to the classification dimensions required in other message transmission modes in this embodiment, and the application is not limited thereto.
[0043] On this basis, the first-type node in the arbitrary area can determine which first-type node has subscribed to the target message identification information based on the message identification information to which the plurality of first-type nodes have respectively subscribed. The plurality of first-type nodes can include the first-type node in the arbitrary area itself. In this way, in the process of message scheduling of the first-type node in the arbitrary area, two cases can occur: the first-type node in the arbitrary area determines that the target message identification information is subscribed by the first-type node in the other area, and the first-type node in the arbitrary area determines that the target message identification information is subscribed by itself.
[0044] For the first case:
[0045] If the first-type node in the arbitrary area determines that there is a first-type node in the other area that has subscribed to the target message identification information, the message can be transmitted to the first-type node in the other area. Correspondingly, the first-type node in the other area can continue to transmit the message so that the message reaches the message receiving end that has subscribed to the target message identification information.
[0046] In this case, in the process of continuing to transmit the message, the first-type node in the other area can treat the message as the received message to be transmitted, and perform message transmission according to the processing logic consistent with the first-type node in the arbitrary area, which is not described herein.
[0047] For the second case:
[0048] The first-type node in the arbitrary area can continue to transmit the message so that the message reaches the message receiving end that has subscribed to the target message identification information.
[0049] In an optional implementation, the first-type node in the arbitrary area can maintain a message queue for each first-type node, and can write the received message into the message queue corresponding to the first-type node. Corresponding to the first case described above, the first-type node in the arbitrary area can write the message into the designated message queue corresponding to the first-type node in the other area, so as to transmit the message to the first-type node in the other area through the designated message queue. After the first-type node in the arbitrary area writes the message into the designated message queue corresponding to the first-type node in the other area, the first-type node in the other area can be pushed with the message in the designated message queue, or the first-type node in the other area can actively pull the message from the designated message queue to achieve the transmission of the message in the first-type node in the arbitrary area to the first-type node in the other area through the designated message queue. Correspondingly, for the second case described above, the first-type node in the arbitrary area can write the message into the message queue corresponding to itself to continue to transmit the message.
[0050] It can be known that, for the first case, the message transmission across the first type nodes can be realized through the scheduling of the first type nodes, and since the different first type nodes are located in different areas, this actually realizes the message transmission across the areas, and the processing logic is simple and the delay is low. For the second case, the first type nodes in any area can be used as a transfer to connect the message transmission channel between the message source and the message receiving end, thereby more efficiently transmitting the message.
[0051] Moreover, in the embodiment, the message identifier information subscribed by each first type node can be dynamically changed according to the actual message receiving end association, so that the first type node can automatically schedule the message to the appropriate first type node after receiving the message without any manual intervention, thereby realizing automatic scheduling of the message among the multiple first type nodes.
[0052] In summary, in the embodiment, a new message transmission system is provided, which includes multiple first type nodes distributed across areas, the network environments of different areas are isolated from each other, the multiple first type nodes can synchronize the message identifier information subscribed by each other, and based on this, for the first type node in any area, after receiving the message to be transmitted, the message identifier information corresponding to the message can be parsed, and if there is a first type node in other areas that has subscribed the parsed message identifier information, the message can be transmitted to the corresponding first type node. Accordingly, in the embodiment, the message transmission across the areas can be realized based on the message scheduling capability of the first type nodes and the cross-area distribution attribute between the first type nodes, and the network environment is no longer limited.
[0053] Figure 2 Another structural schematic diagram of a message transmission system provided by an exemplary embodiment of the present application is provided. Referring to Figure 2 In the above or the following embodiments, the message transmission system can further include multiple second type nodes. The multiple second type nodes can be deployed in the edge cluster mentioned above, and the second type node can be implemented as a single cloud server or a collection of multiple cloud servers.
[0054] Referring to Figure 2In this embodiment, a single second-type node can select a first-type node to connect with. In an exemplary scenario, at least one optional first-type node in network communication with the second-type node can be preconfigured in the second-type node, from which the second-type node can select a first-type node to connect with. Further, a priority of each optional first-type node can be configured, based on which the second-type node can select a first-type node to connect with according to the priority. It is worth mentioning that the optional first-type nodes configured for the second-type node can be located in different areas from the second-type node, in which case the second-type node can serve as a temporary access node in the area where the first-type node it connects with is located, which does not affect the operation of the second-type node.
[0055] In this embodiment, a single second-type node can subscribe to message identification information subscribed by each message receiving end accessing it. The second-type node can synchronize the message identification information it subscribes to to the first-type node it connects with, so that the first-type node it connects with can subscribe to the message identification information the second-type node subscribes to. In this way, the message identification information the first-type node subscribes to can include the message identification information each second-type node it connects with subscribes to.
[0056] In this embodiment, the second-type node can update the message identification information it subscribes to when the number of message receiving ends accessing it changes, and synchronize the updated message identification information to the first-type node it connects with, so as to update the message identification information the first-type node it connects with subscribes to. In this way, the second-type node can update the message identification information it subscribes to in a timely manner, and synchronize it to the first-type node it connects with in a timely manner, which can ensure the accuracy of the message identification information each first-type node subscribes to, and further ensure the accuracy of message transmission.
[0057] In this embodiment, the second-type node can also switch the first-type node it connects with on demand. In actual application, the first-type node the second-type node connects with can no longer meet the preset connection condition due to factors such as network fluctuation, change in message transmission demand, or disconnection between the first-type node initially connected and other first-type nodes through which the message it subscribes to passes. In this case, the second-type node can select a target node meeting the connection condition from other first-type nodes in network communication with it, switch to the target node, and synchronize the message identification information it subscribes to to the target node. Correspondingly, the first-type node the second-type node originally connects with no longer subscribes to the message identification information the second-type node subscribes to. In this way, when the connection relationship between the second-type node and the first-type node changes, the message identification information each related first-type node subscribes to will be updated dynamically, so as to ensure the accuracy of message transmission.
[0058] Based on this, reference can be made to the embodiments of the first-type node and the second-type node described above. Figure 2In the embodiment, for any second-type node, after receiving a message to be transmitted, the message corresponding message identification information is parsed; if it is determined that the node has subscribed to the message identification information, the message is written into the sending queue corresponding to the message identification information, so as to transmit the message to the message receiving end of the second-type node which has subscribed to the message identification information. In this case, the message does not need to be transmitted to the first-type node, but the message transmission can be completed at the second-type node level. That is, the message transmission can be completed at the network edge, without the participation of the first-type node. In actual application, the message flow occurring at the network edge is huge, so the message transmission pressure of the first-type node can be greatly reduced.
[0059] Reference Figure 2 In the embodiment, the second-type node can maintain a sending queue for each message identification information it subscribes to, and each message receiving end of the second-type node can obtain the message from the corresponding sending queue according to the message identification information it subscribes to. Figure 3 An exemplary structure diagram of the sending queue provided by an exemplary embodiment of the present application is shown in FIG. 1a and FIG. 1b. Figure 3 FIG. 1a of the drawings shows the sending queue in the point-to-point transmission mode. Figure 3 FIG. 1b of the drawings shows the sending queue in the publish-subscribe transmission mode. In the embodiment, a single sending queue is identified by a single message identification information. Reference is made to FIG. 1a and FIG. 1b. Figure 3 In the point-to-point transmission mode, the sending queue is identified by the application program name (APP0, APP1) corresponding to the message source end. Reference is made to FIG. 1a. Figure 3 In the publish-subscribe transmission mode, the sending queue is identified by the application program name and the message topic name (APP0+TOPIC0, APP1+TOPIC0) corresponding to the message source end. Reference is made to FIG. 1b.
[0060] Continuing to refer to FIG. 1a and FIG. 1b, Figure 2 For the second-type node, if it is determined that it does not subscribe to the message identification information parsed from the received message, the message is transmitted to the first-type node connected thereto, so as to continue to transmit the message through the first-type node connected thereto. In this case, the message receiving end which subscribes to the message does not access the second-type node, and in this case, the message can be transmitted to the first-type node connected to the second-type node through the second-type node. Since the first-type node has a more comprehensive perspective of the message identification information, the first-type node can further schedule the message.
[0061] It should be understood that after the message reaches the first-type node to which the second-type node is connected, the message can be further transmitted according to the processing logic of the foregoing embodiments with respect to the first-type node in any area (this corresponds to the case mentioned above that the message is forwarded to the first-type node through other transit links). As mentioned above, after the message reaches the first-type node in any area, two cases can occur in the process of scheduling the message in the first-type node in any area. The following continues to describe the solution of the first-type node in any area for further transmitting the message, in continuation of the second case mentioned above, that is, the first-type node in any area determines that it has subscribed to the target message identification information.
[0062] For the first-type node in any area, when receiving the message transmitted by any second-type node connected thereto, if it is determined that there is another second-type node that has subscribed to the target message identification information among the second-type nodes connected thereto, the message can be transmitted to the other second-type node. In this case, optionally, the first-type node in any area can write the message into the target message queue corresponding to the other second-type node, so as to transmit the message to the other second-type node through the target message queue.
[0063] Correspondingly, for the other second-type node, the message can be written into the sending queue corresponding to the target message identification information, so as to transmit the message to the message receiving end that is connected to the other second-type node and has subscribed to the target message identification information.
[0064] In this case, the message needs to be transmitted to the first-type node and the message transmission is completed at the level of the first-type node, but does not need to be transmitted across the first-type node.
[0065] In the solution described above, the message queue maintained by the first-type node in any area can include the message queue maintained by each second-type node connected thereto. In this way, the first-type node in any area can transmit the message to the second-type node by writing the message into the message queue corresponding to the second-type node. Based on this, the first-type node in any area can serve as a transit between any two second-type nodes connected thereto, so as to transmit the message produced by the message source connected to any second-type node to the message receiving end connected to the other second-type node. (This corresponds to the case mentioned above that the message receiving end indirectly obtains the message in the first-type node through other transit links)
[0066] Accordingly, the message source end or the message receiving end can access the second type node which is closer or has a better network state, so as to access the message transmission network composed of the second type node and the first type node, and then the message transmission can be completed faster through the message transmission network. Especially for the message source end or the message receiving end which is far away from the management center, the message transmission efficiency can be obviously improved by the transmission through the second type node compared with the transmission by directly accessing the first type node.
[0067] In addition, the first type node in any area can subscribe to the message identifier information subscribed by each message receiving end directly connected to the first type node in addition to the message identifier information subscribed by each second type node connected to the first type node. Based on this, for the first type node in any area, if there is a target message receiving end which subscribes to target message identifier information among the message receiving ends directly connected to the first type node, the message is written into the sending queue corresponding to the target message identifier information, so as to transmit the message to the target message receiving end. That is, the first type node in any area can maintain a sending queue for the message identifier information subscribed by each message receiving end directly connected to the first type node, so that the message receiving end can directly obtain the message from the sending queue in the first type node connected to the message receiving end. It can be known that in the embodiment, the sending queue can be maintained in the first type node and the second type node to support the message receiving end to directly access and obtain the message.
[0068] Preferably, in the embodiment, any first type node or second type node can also judge whether the message receiving end directly connected to the first type node or the second type node has obtained the subscription permission of the requested subscription message identifier information; if yes, the target message receiving end is allowed to subscribe to the requested subscription message identifier information; if not, the target message receiving end is prohibited to subscribe to the requested subscription message identifier information.
[0069] In an optional implementation, a management interface can be provided to a user, where the user refers to the owner of an application (i.e. a message source end or a message receiving end). The user can configure the subscription permission for each application owned by the user in the management interface, and the subscription permission configured by the user will be synchronized to the second type node accessed by the application or the first type node accessed by the application, so as to be used as the basis for the above permission verification. For example, the user can specify authorized application b and c for the application a owned by the user, so that only the application b and c have the subscription permission for each message topic of the application a, and other applications cannot subscribe to any message topic of the application a. Of course, in actual application, the application a can have the subscription permission for each message topic of the application a by default without manual authorization.
[0070] By verifying the subscription permission of the message receiving end, not only the application granularity information isolation mentioned above can be realized, but also the application granularity authorization management can be realized, and different applications need to be authorized to obtain the messages produced by the other party, which realizes an application granularity message protection concept, especially in the publish / subscribe transmission mode, the security of the messages produced by each application can be better protected.
[0071] With reference to the foregoing Figure 2 In this embodiment, the message transmission system can also include a third type of node, which can also be deployed in the edge cluster mentioned above, especially in the edge cluster with a size less than a specified standard, for example, in the edge cluster with a size less than 3 cloud servers.
[0072] For the third type of node, it can be connected to the first type of node and / or the second type of node. The third type of node can use distance, network quality, load, performance, and the like as selection basis to select a suitable first type of node or second type of node for connection. Based on this, for any third type of node, the messages produced by the message source end connected to the third type of node can be forwarded to the first type of node and / or the second type of node connected to the third type of node, and the messages sent by the first type of node and / or the second type of node connected to the third type of node can be forwarded to the message receiving end connected to the third type of node and subscribing to the message identifier information corresponding to the messages. The first type of node and / or the second type of node accessed by the third type of node can subscribe to the message identifier information subscribed by each message receiving end directly connected to the third type of node.
[0073] In this way, the third type of node can act as a forwarding agent of the associated first type of node and / or second type of node. That is, the third type of node can support the access of the message source end and the message receiving end, but does not need to provide message storage for the message source end and the message receiving end connected thereto, but forwards the related requests of the message source end and the message receiving end connected thereto to the corresponding first type of node and / or second type of node. Based on the third type of node, the message source end or the message receiving end can be connected to the third type of node that is closer or has a better network state, thereby accessing the message transmission network composed of the third type of node, the second type of node, and the first type of node, and then the message transmission can be completed faster through this message transmission network. Especially for the message source end or the message receiving end that is far away from the first type of node or the second type of node, this access mode can significantly improve the message transmission efficiency.
[0074] In summary, in the embodiment, the message transmission network formed by the third type nodes, the second type nodes and the first type nodes can be accessed by the message source end and the message receiving end as needed through the appropriate access points, and the third type nodes, the second type nodes and the first type nodes can cooperate with each other to determine a suitable transmission path for the to-be-transmitted message in the message transmission network, so that the message transmission can be completed more efficiently and more accurately.
[0075] In the above or the following embodiments, in the case where the first type node includes a plurality of cloud servers, the plurality of cloud servers can synchronize the messages and the subscribed message identification information based on a consensus mechanism. The consensus mechanism is a technology for reaching a consensus in cognition and behavior among nodes through voting among the nodes. Based on the consensus mechanism, in the embodiment, the plurality of cloud servers included in a single first type node can keep consistent in cognition and behavior for the messages and the subscribed message identification information.
[0076] In the embodiment, in the case where the second type node includes a plurality of cloud servers, the plurality of cloud servers in the second type node can also synchronize the messages and the message identification information based on a consensus mechanism. Considering the uncertainty of the number of cloud servers included in a single second type node, in the embodiment, the existing consensus mechanism is also optimized.
[0077] In an exemplary optimization scheme, the first type node connected to the second type node can specify a part of the cloud servers included in the second type node to participate in the consensus mechanism in the case where the number of the cloud servers included in the second type node exceeds a specified threshold, so that the messages and the message identification information are synchronized in the second type node based on the consensus mechanism through the specified part of the cloud servers. In the optimization scheme, in the case where the number of the cloud servers in the second type node is too large, in order to reduce the complexity of the consensus mechanism, the first type node connected to the second type node can specify a part of the cloud servers to participate in the consensus mechanism, and the remaining cloud servers can act as proxy servers. The proxy servers do not need to participate in the consensus mechanism, but can support other related work of the second type node as described above. Since the messages and the message identification information after the consensus are not obtained in full amount, the proxy servers can forward the messages to the cloud servers acting as the main role in the consensus mechanism when the messages are received, and can obtain the messages from the cloud servers acting as the secondary role in the consensus mechanism when the message receiving end connected thereto needs to obtain the messages.
[0078] In the optimization scheme: the first type node connected to the second type node can also send the voting master information to each cloud server participating in the voting master in the second type node as the voting master role in the case of failure of the voting master link in the consensus mechanism process, so as to select the cloud server as the master role in the second type node. For example, in the case of only one cloud server in the second type node, the first type node connected to the second type node can specify that the cloud server is always the master role. For another example, in the case of an even number of cloud servers in the second type node, the first type node connected to the second type node can participate in the voting master link as the voting master role to select the cloud server as the master role.
[0079] In this way, based on the consensus mechanism, in the embodiment, the cognition and behavior of the multiple cloud servers in a single second type node to the message and message identification information can be kept consistent.
[0080] In addition, in the embodiment, the consensus mechanism can also be used between the multiple first type nodes to synchronize the subscribed message identification information. This can ensure that the cognition and behavior of the multiple first type nodes to the subscribed message identification information are consistent.
[0081] In the embodiment, the consensus mechanism can use Paxos algorithm or Raft algorithm, and the type of the consensus algorithm used in the embodiment is not limited.
[0082] In addition, in the embodiment, storage logic can be pre-stored in the first type node and the second type node, and two optional modes can be pre-stored in the storage logic: storage and calculation separation mode and storage and calculation integration mode. The storage and calculation separation mode means that the storage and calculation are separated, and the storage and calculation integration mode means that the storage and calculation are integrated. As mentioned above, in the embodiment, the multiple first type nodes can be deployed in different central clusters, and considering that the storage resources in the central cluster are rich, preferably, a single first type node can be configured to store messages using the storage resources in the central cluster where it is located. Of course, a single first type node can also be configured to store messages using its own storage resources, and the embodiment does not limit this. As mentioned above, in the embodiment, the multiple second type nodes can be deployed in different edge clusters, and considering that the storage resources in the edge cluster are relatively scarce, preferably, a single second type node can be configured to store messages using its own storage resources. Of course, a single second type node can also be configured to store messages using the storage resources in the edge cluster where it is located, and the embodiment does not limit this.
[0083] It can be known that in the embodiment, the flexible storage mode can be supported, different types of nodes can be deployed quickly and maintained easily, and the requirement of different message storage time length can be adapted.
[0084] In summary, in the embodiment, the first type node and the second type node can be implemented as a cluster. Through the cooperation between the cloud servers in the cluster, the related functions of the first type node and the second type node can be implemented. The basic cooperation logic between the cloud servers in the cluster can refer to the related knowledge of the master-slave mode in the cluster, and will not be described in detail here. Through the consensus mechanism, the consistency of cognition and behavior between the cloud servers in the node can be ensured, so that the accuracy of message transmission can be ensured. In addition, through the flexible and adjustable storage mode, the differentiated storage requirements of different nodes and different messages can be adapted, and the application range of the message transmission system can be improved.
[0085] The message transmission system provided in the embodiment will be described below through several application scenarios.
[0086] Application scenario 1
[0087] Figure 4 The scheme logic diagram corresponding to the application scenario 1 of the example embodiment of the present application is provided. Referring to Figure 4 , the message source end is located in Wuzheng District, Huzhou City, China, the application program name corresponding to the message source end is APP0, APP0 has provided authorization to the message receiving end APP1. The message receiving end APP1 is located in New York City, USA. The message source end APP0 can also be pre-configured with multiple selectable access addresses (the first type node address, the second type node address or the third type node address in the message transmission system of the embodiment), the message source end APP0 determines to access the second type node I deployed in Huzhou City; the message receiving end APP1 determines to access the first type node P deployed in the New York region of the United States. The first type node P subscribes to the message identifier information APP0+TOPIC1 subscribed by the message receiving end APP1, and the message identifier information subscribed by the first type node P is synchronized to the first type node M located in the East China region of China.
[0088] On this basis, when the message source end APP0 produces a message, the message source end APP0 can transmit the message to the second type node I, the second type node I can parse the message identifier information of the message as APP0+TOPIC1, and the second type node I does not find the message identifier information in the message identifier information it subscribes to, so it can transmit the message to the first type node M connected thereto.
[0089] The first type node M finds that the first type node P has subscribed to the message identifier information, so it can write the message into the message queue corresponding to the first type node P.
[0090] The first type node P can continuously pull messages from the message queue in the first type node M. After pulling the message produced by the message source end APP0, the message realizes cross-border transmission. Then, the first type node P can write the message into the sending queue corresponding to the message identification information APP0+TOPIC1. The message receiving end APP1 can obtain the message from the sending queue.
[0091] In this application scenario, the message source end can access the second type node in the region, and the cross-regional message transmission is completed by the second type node and the plurality of first type nodes. In this application scenario, the message receiving end APP1 can switch the node to which it accesses, for example, it can switch to the first type node Q located in another region. In the process of scheduling the message with the message identification information APP0+TOPIC1, the first type node M can automatically write the message into the message queue corresponding to the first type node Q, so that in the case of cross-regional message transmission, the message can be automatically scheduled to the appropriate first type node according to the change of the message receiving end associated with each first type node, without any manual intervention.
[0092] In addition, in this application scenario, there can be a message source end APP2 directly connected to the first type node M. In the case that the message receiving end APP1 has subscribed to the message identification information APP2+TOPIC1, when the message source end APP2 produces a message, the message source end APP2 can directly send the message to the first type node M. Since the first type node P has subscribed to the message identification information APP2+TOPIC1, the first type node M writes the message into the message queue corresponding to the first type node P to transmit to the first type node P, and the first type node P further transmits the message to the message receiving end APP1.
[0093] In this case, the message source end can realize cross-regional message transmission by directly accessing the first type node.
[0094] Application scenario 2
[0095] Figure 5 The application scenario 2 corresponding to the scheme logic diagram provided by an exemplary embodiment of the present application. Reference is made to Figure 5 , and Figure 4Different from the above, the message source APP0 is located in Wuzheng District of Huzhou City, China, and the message receiving end APP1 is located in Xuanwu District of Nanjing City, China. In the case of using the publish / subscribe transmission mode, the message receiving end APP1 subscribes to the TOPIC1 of the message source APP0. The message source APP0 determines to access the second type node I deployed in Huzhou City, and the message receiving end APP1 determines to access the second type node K deployed in Nanjing City. The second type node I and the second type node K are both connected to the first type node M deployed in the East China region. The message identification information APP0+TOPIC1 subscribed by the message receiving end APP1 is recorded in the message identification information subscribed by the second type node K, and can be synchronized to the first type node M for synchronous subscription.
[0096] On this basis, when the message source APP0 produces a message, the message source APP0 can transmit the message to the second type node I. The second type node I can parse the message identification information of the message as APP0+TOPIC1, and does not find the message identification information in the message identification information it subscribes to, so it can transmit the message to the first type node M connected thereto.
[0097] The first type node M finds that it has subscribed to the message identification information, and specifically, the second type node K has subscribed to the message identification information, so it can write the message into the message queue corresponding to the second type node K.
[0098] The second type node K can continuously pull the message from the message queue in the first type node M, and after pulling the message produced by the message source APP0, it can write the message into the sending queue corresponding to the message identification information APP0+TOPIC1. The message receiving end APP1 can obtain the message from the sending queue.
[0099] In this application scenario, the message transmission between the message source and the message receiving end can be completed by the second type node and the first type node connected thereto, and the message autonomy in the region where the first type node is located can be realized without using other first type nodes.
[0100] Application scenario 3
[0101] Figure 6 The application scenario 3 corresponding to the scheme logic diagram provided by an exemplary embodiment of the present application. Referring to Figure 6, the message source end APP0 is located in Wuzheng District of Huzhou City, China, and the message receiving end APP1 is located in Nanxun District of Huzhou City, China. The message source end APP0 determines to access the second type node I deployed in Huzhou City, and the message receiving end APP1 also selects to access the second type node I. The message identification information APP0 subscribed by the message receiving end APP1 is recorded in the message identification information subscribed by the second type node I.
[0102] On this basis, when the message source end APP0 produces a message in a point-to-point transmission mode, the message source end APP0 can transmit the message to the second type node I, the second type node I can parse the message identification information of the message as APP0, and the second type node I can find the message identification information in the message identification information subscribed by itself, so as to write the message into the sending queue corresponding to the message identification information. In this way, the message receiving end APP1 accessing the second type node I can obtain the message from the sending queue.
[0103] In this application scenario, the message transmission between the message source end and the message receiving end can be independently completed by the second type node, the message autonomy in the area where the second type node is located can be realized, and the first type node does not need to be used.
[0104] It should be understood that the above application scenario is only exemplary, and other message transmission conditions exist in actual applications, but the transmission path can be automatically determined in the message transmission system provided by the embodiment without manual specification, and the transmission efficiency and accuracy of the determined transmission path can be ensured based on the accurate consensus of the message identification information between nodes.
[0105] Figure 7 A flowchart of a message transmission method provided by another exemplary embodiment of the present application is provided. The method can be executed by a data processing device, which can be implemented as software, hardware or a combination of software and hardware, and can be integrated into the first type node of the message transmission system. The message transmission system can include a plurality of first type nodes distributed across borders. Taking the first type node in any region as an example, referring to Figure 7 , the method can include:
[0106] Step 700, after receiving a message to be transmitted, parsing the target message identification information corresponding to the message;
[0107] Step 701, if there is a first type node in other regions that has subscribed to the target message identification information, transmitting the message to the first type node in other regions for further transmission, so that the message reaches the message receiving end that has subscribed to the message identification information;
[0108] The first type node in the plurality of regions subscribes to message identification information subscribed by each message receiving end associated with the first type node.
[0109] In an optional embodiment, the step 701 can specifically include:
[0110] writing the message into a designated message queue corresponding to the first type node in the other region, so as to transmit the message to the first type node in the other region through the designated message queue.
[0111] In an optional embodiment, the message transmission system can further include a plurality of second type transmission nodes, and the method can further include:
[0112] subscribing to message identification information subscribed by each second type node connected to the first type node;
[0113] The received message to be transmitted includes a message sent by any second type node connected to the first type node.
[0114] In an optional embodiment, the method can further include:
[0115] If there is another second type node that has subscribed to the target message identification information in the plurality of second type nodes connected to the first type node, the message is transmitted to the other second type node;
[0116] The other second type node can write the message into a sending queue corresponding to the target message identification information, so as to transmit the message to a message receiving end connected to the other second type node and having subscribed to the target message identification information.
[0117] In an optional embodiment, the method can further include:
[0118] If there is a target message receiving end that has subscribed to the target message identification information in each message receiving end directly connected to the first type node in any region, the message is written into a sending queue corresponding to the target message identification information, so as to transmit the message to the target message receiving end.
[0119] In an optional embodiment, the message identification information includes application identification information corresponding to a message source end and / or message topic identification information, wherein the message topic identification information includes an application name and a message topic name corresponding to the message source end.
[0120] In an optional embodiment, the method can further include:
[0121] determining whether the message receiving end directly connected to the first type node has obtained a subscription right of the requested subscription message identification information;
[0122] If the target message receiving end has obtained the subscription right, the target message receiving end is allowed to subscribe to the requested subscription message identification information.
[0123] If not obtained, the target message receiving end is prohibited from subscribing to the requested message identification information.
[0124] In an optional embodiment, the method can further include:
[0125] In the case of disconnection with the connected second-type node, the message identification information subscribed by the disconnected second-type node is synchronously deleted from the message identification information to which the node itself subscribes.
[0126] In an optional embodiment, the method can further include:
[0127] Receiving the updated message identification information sent by the second-type node connected thereto;
[0128] Updating the message identification information to which the node itself subscribes.
[0129] In an optional embodiment, the plurality of first-type nodes are deployed in different central clusters; and the plurality of second-type nodes are deployed in different edge clusters.
[0130] In an optional embodiment, the synchronization of the subscribed message identification information among the plurality of first-type nodes is based on a consensus mechanism; and the plurality of cloud servers are contained in a single first-type node and the synchronization of the messages and the subscribed message identification information among the plurality of cloud servers is based on a consensus mechanism.
[0131] In an optional embodiment, the plurality of cloud servers are contained in a single second-type node, and the method can further include:
[0132] In the case that the number of the cloud servers contained in the second-type node exceeds a specified threshold, a specified part of the cloud servers participating in the consensus mechanism is specified from the cloud servers contained in the second-type node, so that the synchronization of the messages and the subscribed message identification information in the second-type node is based on the consensus mechanism through the specified part of the cloud servers; and
[0133] In the case that the voting master selection link in the consensus mechanism process fails between the cloud servers contained in the second-type node, the voting master selection information is sent to each cloud server participating in the voting master selection in the second-type node as a voting master selection role, so that the cloud server acting as a master role in the consensus mechanism process is selected in the second-type node.
[0134] In an optional embodiment, the message transmission system can further comprise a third type of node, which can forward a message produced by a message source connected to the third type of node to a first type of node and / or a second type of node connected to the third type of node, and forward a message sent by the first type of node and / or the second type of node connected to the third type of node to a message receiver connected to the third type of node and subscribed to a message identifier of the message.
[0135] It should be noted that the technical details of the above embodiments of the message transmission method can refer to the above-mentioned related description of the first type of node in the system embodiments, and will not be described here again in order to save space, but this should not cause the loss of the protection scope of the present application.
[0136] Figure 8 Another flowchart of another message transmission method provided by another exemplary embodiment of the present application is shown, which can be executed by a data processing apparatus, which can be implemented as software, hardware or a combination of software and hardware, and can be integrated into any second type of node in the message transmission system. The message transmission system can further comprise a plurality of first type of nodes distributed across borders, which can refer to the above-mentioned related description of the first type of node in the system embodiments. Figure 8 The method can comprise:
[0137] Step 800: After receiving a message to be transmitted, the message identifier corresponding to the message is parsed.
[0138] Step 801: If it is determined that the second type of node is not subscribed to the message identifier, the message is transmitted to the first type of node connected to the second type of node, so as to continue the transmission of the message through the first type of node.
[0139] The second type of node subscribes to the message identifiers subscribed by each message receiver connected to the second type of node, and the first type of node supports transmitting the received message to other first type of nodes or to other second type of nodes connected to the first type of node.
[0140] In an optional embodiment, the method can further comprise:
[0141] The message identifier subscribed by the second type of node is provided to the first type of node connected to the second type of node, so that the first type of node subscribes to the message identifier subscribed by the second type of node.
[0142] In an optional embodiment, the method can further comprise:
[0143] If it is determined that the second type of node has subscribed to the parsed message identifier, the message is written into a sending queue corresponding to the message identifier, so as to transmit the message to a message receiver connected to the second type of node and subscribed to the message identifier.
[0144] In an optional embodiment, the message identification information comprises application identification information corresponding to the message source and / or message topic identification information, wherein the message topic identification information comprises an application name and a message topic name corresponding to the message source.
[0145] In an optional embodiment, the method can further comprise:
[0146] determining whether the target message receiving end connected therewith has the subscription right to the requested subscription message identification information;
[0147] if so, allowing the target message receiving end to subscribe to the requested subscription message identification information;
[0148] if not, prohibiting the target message receiving end from subscribing to the requested subscription message identification information.
[0149] In an optional embodiment, the method can further comprise:
[0150] selecting a target node meeting the connection condition from other first-type nodes in network communication with the first-type node in the case that the first-type node connected therewith no longer meets the connection condition;
[0151] establishing connection with the target node;
[0152] synchronizing the subscribed message identification information to the target node;
[0153] wherein the first-type node originally connected with the second-type node no longer subscribes to the message identification information subscribed by the second-type node.
[0154] In an optional embodiment, the method can further comprise:
[0155] updating the message identification information subscribed by itself in the case that the number of message receiving ends accessing it increases or decreases;
[0156] synchronizing the updated message identification information to the first-type node connected therewith to update the message identification information subscribed by the first-type node.
[0157] In an optional embodiment, a plurality of first-type nodes are deployed in different central clusters; and a plurality of second-type nodes are deployed in different edge clusters.
[0158] In an optional embodiment, a plurality of cloud servers are contained in a single second-type node, and any one of the cloud servers in the second-type node is further configured to:
[0159] In a case of failure in the voting leader election in the consensus mechanism process, a voting leader election request is sent to the first type node connected to the second type node, so that the first type node serves as a voting leader role and sends voting leader election information to each cloud server in the second type node participating in the voting leader election, so as to select a cloud server as a main role in the consensus mechanism process in the second type node.
[0160] It should be noted that the technical details in the above embodiments of the message transmission method can refer to the related description of the second type node in the foregoing system embodiments. For the sake of brevity, they will not be repeated here, but this should not cause a loss of the scope of protection of the present application.
[0161] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can also be executed by different devices as the execution subject. In addition, in some of the processes described in the above embodiments and the accompanying drawings, a plurality of operations appearing in a specific order are included, but it should be clear that these operations can be executed or executed in parallel without the order in which they appear in this text. The serial numbers of the operations, such as 700, 701, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes can include more or fewer operations, and these operations can be executed in sequence or in parallel. It should be noted that the "first", "second", etc. in this text are used to distinguish different messages, nodes, etc., and do not represent the order of precedence. Also, "first" and "second" are not of different types.
[0162] Figure 9 A structural schematic diagram of a message transmission device provided for another exemplary embodiment of the present application is shown in FIG. 9. As shown in FIG. 9, the message transmission device can include a memory 90, a processor 91, and a communication component 92. The processor 91 is coupled with the memory 90 and the communication component 92, and is configured to execute a computer program in the memory 90 for executing the method logic of the method performed by the first type node or the second type node provided in the foregoing method embodiments. For the sake of brevity, the technical details described in the foregoing system embodiments or method embodiments will not be repeated here, but this should not cause a loss of the scope of protection contained in the present application. Figure 9 Further, as shown in FIG. 9, the message transmission device further includes a power supply component 93 and other components.
[0163] Figure 9 It is only schematically shown that some components, and it does not mean that the message transmission device only includes the components shown in FIG. 9. Figure 9 Figure 9
[0164] Accordingly, the embodiments of the present application also provide a computer readable storage medium storing a computer program, the computer program being executed to implement each step performed by the message transmission device in the method embodiments.
[0165] The memory in the above Figure 9 is configured to store the computer program and can be configured to store other various data to support operations on the computing platform. Examples of these data include instructions for any application program or method operating on the computing platform, contact data, phonebook data, messages, pictures, videos, and the like. The memory can be implemented by any type of volatile or nonvolatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0166] The communication component in the above Figure 9 is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G, or the like mobile communication network, or a combination thereof. In an example embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component further includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0167] The power supply component in the above Figure 9 supplies power to various components of the device where the power supply component is located. The power supply component can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.
[0168] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer usable program code.
[0169] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.
[0170] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.
[0171] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.
[0172] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0173] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory. The memory is an example of computer-readable media.
[0174] Computer-readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0175] It should also be noted that the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0176] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0177] The above only describes the embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A message transmission system comprising multiple second-type nodes and multiple first-type nodes distributed across regions, wherein the network environments of different regions are isolated from each other; Any second-type node is used to: subscribe to message identifier information subscribed by each message receiver it is connected to; after receiving a message to be transmitted, parse out the target message identifier information corresponding to the message, and transmit the message to the first-type node connected to it if the target message identifier information is not subscribed to, so that the message can continue to be transmitted through the first-type node; A first-type node in any region is used to parse the target message identifier information corresponding to the message after receiving the message to be transmitted; if there are first-type nodes in other regions that have subscribed to the target message identifier information, the message is transmitted to the first-type nodes in those other regions. The first type of node in the other areas is used to continue transmitting the message so that the message reaches the message receiving end that subscribed to the target message identification information; in, The first type of node in multiple regions subscribes to the message identification information subscribed to by each message receiver associated with it, and also subscribes to the message identification information subscribed to by the second type of node connected to it.
2. The system according to claim 1, wherein when a first type node in any region transmits the message to a first type node in the other regions, it is specifically used for: The message is written into a designated message queue corresponding to the first type node in the other region, so as to transmit the message to the first type node in the other region through the designated message queue.
3. The system according to claim 1, wherein the second type of node is further configured to: When the target message identifier information is subscribed, the message is written into the sending queue corresponding to the message identifier information, so as to transmit the message to the message receiving end connected to the second type node and subscribing to the target message identifier.
4. The system according to claim 1, wherein the first type of node in any region is further used for: If any of the multiple second-type nodes connected to it have subscribed to the target message identifier information, then the message will be transmitted to the other second-type nodes. The other second type of node is used to write the message into the sending queue corresponding to the target message identifier information, so as to transmit the message to the message receiving end connected to the other second type of node and subscribed to the target message identifier information.
5. The system according to claim 4, wherein the first type of node is further configured to: If there is a target message receiver that has subscribed to the target message identifier information among the message receivers directly connected to it, the message is written into the sending queue corresponding to the target message identifier information so as to transmit the message to the target message receiver.
6. The system according to claim 1, wherein the message identification information includes application identification information and / or message topic identification information corresponding to the message source, wherein, The message topic identification information includes the application name and message topic name corresponding to the message source.
7. The system according to claim 1, wherein the first type of node or the second type of node is further configured to: Determine whether the target message receiver directly connected to it has obtained subscription permission for the requested message identifier information; If already obtained, the target message receiver is allowed to subscribe to the requested message identifier information; If not obtained, the target message receiver is prohibited from subscribing to the requested message identifier information.
8. The system according to claim 1, wherein the second type of node is further configured to: select a target node that meets the connection conditions from other first type nodes connected to its network when the first type node to which it is connected no longer meets the connection conditions; establish a connection with the target node; and synchronize the subscribed message identification information to the target node; The first type of node is also used to: synchronously delete the message identification information subscribed to by the disconnected second type of node from its own subscribed message identification information when it is disconnected from the second type of node it is connected to.
9. The system according to claim 1, wherein the plurality of first-type nodes are deployed in a central cluster, and the plurality of second-type nodes are deployed in an edge cluster.
10. The system according to any one of claims 1-9, wherein the second type of node includes multiple cloud servers, and the first type of node is further configured to: If the number of cloud servers contained within the second type of node exceeds a specified threshold, a subset of cloud servers from the second type of node are designated to participate in the consensus mechanism, so that message and subscribed message identification information are synchronized within the second type of node based on the consensus mechanism through the designated subset of cloud servers; and, If the voting process for electing a leader fails during the consensus mechanism among the cloud servers included in the second type of node, the cloud server acting as the voting leader sends voting leader information to each cloud server participating in the voting process within the second type of node, so as to elect the cloud server that plays the leading role in the consensus mechanism within the second type of node.
11. The system according to any one of claims 1-9, further comprising a third type of node for... Forward messages produced by the message source end connected to the third type node to the first type node and / or the second type node connected to the third type node; The messages sent by the first type node and / or the second type node connected to the third type node are forwarded to the message receiving end connected to the third type node and subscribing to the message identification information corresponding to the message.
12. A message transmission method applicable to first-type nodes in any region of a plurality of first-type nodes distributed across regions, wherein the network environments of different regions are isolated from each other, the method comprising: After receiving the message to be transmitted, the target message identifier information corresponding to the message is parsed out; If there are first-type nodes in other regions that have subscribed to the target message identifier information, the message will be transmitted to the first-type nodes in those other regions for further transmission, so that the message reaches the message receiving end that has subscribed to the message identifier information. In this system, first-type nodes in multiple regions subscribe to message identifier information subscribed to by each message receiver associated with them, and also subscribe to message identifier information subscribed to by second-type nodes connected to them. Any second-type node is used to: subscribe to message identifier information subscribed to by each message receiver connected to it; upon receiving a message to be transmitted, parse out the target message identifier information corresponding to the message, and transmit the message to the first-type node connected to it without subscribing to the target message identifier information, so that the message can continue to be transmitted through the first-type node.
13. A message transmission method applicable to any second-type node in a message transmission system, wherein the message transmission system further includes multiple first-type nodes distributed across regions, the network environments of different regions being isolated from each other, and the first-type nodes in the multiple regions subscribing to message identification information subscribed to by each message receiver associated with them, the method comprising: After receiving the message to be transmitted, the message identifier information corresponding to the message is parsed out; If it is determined that it has not subscribed to the message identifier information, the message is transmitted to the first type of node it is connected to, so that the message can continue to be transmitted through the first type of node; The second type of node subscribes to the message identification information subscribed to by each message receiver it connects to, while the first type of node supports transmitting received messages to first type nodes in other areas or to other second type nodes it connects to.
14. A message transmission device, comprising a memory, a processor, and a communication component; the memory being used to store one or more computer instructions; the processor being coupled to the memory and the communication component, and executing the one or more computer instructions to perform the message transmission method according to any one of claims 12 or 13.
15. A computer-readable storage medium storing computer instructions that, when executed by one or more processors, cause the one or more processors to perform the message transmission method of any one of claims 12 or 13.
Citation Information
Patent Citations
Cross-region message communication method and device, electronic equipment and storage medium
CN113452600A