Message transmission method and device

By integrating the ZeroMQ communication model in the cloud real machine platform and using routing matching rules for message distribution and synchronization, the problem of non-real-time and low efficiency in message transmission in the existing technology is solved, and complex message delivery scenarios under the cloud real machine platform are realized. Efficient transmission.

CN118540368APending Publication Date: 2024-08-23BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410725396.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The existing ZeroMQ communication library cannot effectively support complex messaging scenarios and frequent data interactions in the cloud real machine platform, resulting in non-real-time and low efficiency of message transmission.

Method used

By integrating the basic communication model of ZeroMQ, a new communication model is formed, including a data push unit, a target transmission unit, a scheduling layer node, a data receiving unit, and a data subscription unit. Routing matching rules are used for message distribution and synchronization to achieve cross-node message transmission.

Benefits of technology

It improves the efficiency and reliability of message transmission, meets the needs of complex message transmission scenarios under the cloud real machine platform, and realizes real-time sharing and standardized transmission of messages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540368A
    Figure CN118540368A
Patent Text Reader

Abstract

The invention mainly discloses a message transmission method and device, and relates to the technical field of computers. The method mainly comprises the following steps: acquiring a target message, and pushing the target message to a target transmission unit by adopting a data pushing unit in a pushing mode; using the target transmission unit to receive the target message through the push mode; switching the target transmission unit from a push mode to a routing mode, so as to send the target message to a scheduling layer node through the routing mode; based on a routing matching rule, distributing the target message to at least one data receiving unit having a routing relationship with the scheduling layer node through a routing mode by adopting the scheduling layer node; and switching the data receiving unit from a routing mode to a subscription mode so as to synchronize the target message to the data subscription unit. According to the embodiment, the problem that the messages cannot be shared in real time due to the fact that the communication modes of all the nodes are not unified can be avoided, and the requirements for complex message transmission scenes and frequent and massive data interaction under a cloud real machine platform are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a message transmission method and device. Background Art

[0002] Each module in the cloud real machine platform system needs to perform fast cross-node communication and data status synchronization. Therefore, there is very frequent data interaction during its use, and there are high requirements for the real-time performance of the data.

[0003] When the ZeroMQ (Zero Message Queue) communication library is used as the node communication library at the bottom of the cloud real machine platform, the ZeroMQ communication library communicates based on TCP (Transmission Control Protocol) Socket. After abstraction and encapsulation, the basic communication mode of the ZeroMQ communication library is formed. However, when using it, due to the frequent data interaction and complex message transmission scenarios of the cloud real machine platform, data messages with different contents can be generated. Different contents lead to different communication modes used during transmission. Each basic communication mode in the ZeroMQ communication library can only be used independently, and only a single basic communication mode can be provided. A single communication mode cannot support message communication with different contents, which has great limitations for complex message transmission scenarios in the cloud real machine. In summary, the current message transmission method cannot meet the system requirements of data interaction on the cloud real machine platform. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a message transmission method and device, which integrates the basic communication mode of ZeroMQ to form a communication mode that can simultaneously transmit messages with different contents, so as to meet the complex message transmission scenarios and frequent data interactions under the cloud real machine platform.

[0005] To achieve the above objective, according to one aspect of an embodiment of the present invention, a message transmission method is provided.

[0006] A message transmission method according to an embodiment of the present invention includes: Obtaining a target message, and using a data push unit to push the target message to a target transmission unit through a push mode; wherein the target message is at least used to represent a user message or a feedback message; Using the target transmission unit to receive the target message in a push mode; Switching the target transmission unit from a push mode to a routing mode, so as to send the target message to the scheduling layer node through the routing mode; Based on the routing matching rule, the scheduling layer node is used to distribute the target message to at least one data receiving unit having a routing relationship therewith through a routing mode; The data receiving unit is switched from a routing mode to a subscription mode to synchronize the target message to the data subscription unit.

[0007] Optionally, when the target message represents the user message, the data push unit is a user layer node, the target transmission unit is a first service layer node downstream of the user layer node, the data receiving unit is a second service layer node downstream of the scheduling layer node, and the data subscription unit is a system layer node; The user layer node pushes the user message to the first service layer node downstream thereof through the push mode, so that the first service layer node receives the user message through the push mode; Switching the first service layer node from the push mode to the routing mode to send the user message to the scheduling layer node through the routing mode; Based on the routing matching rule, the scheduling layer node is used to distribute the user message to at least one of the second service layer nodes having a routing relationship therewith through a routing mode; The second business layer node is switched from the routing mode to the subscription mode to synchronize the user message to the system layer node.

[0008] Optionally, when the target message represents the feedback message, the data push unit is a system layer node, the target transmission unit is the second service layer node, the data receiving unit is the first service layer node, and the data subscription unit is a user layer node; The system layer node is used to push the feedback message to the downstream second business layer node through the push mode, so that the second business layer node receives the feedback message through the push mode; Switching the second service layer node from the push mode to the routing mode to send the feedback message to the scheduling layer node through the routing mode; Based on the routing matching rule, the scheduling layer node distributes the feedback message to at least one of the first service layer nodes having a routing relationship therewith through a routing mode; The first service layer node is switched from the routing mode to the subscription mode to synchronize the feedback message to the user layer node.

[0009] Optionally, when there is a newly created node, the newly created node is registered in an upstream node associated with it based on a subscription mode; Among them, the above-mentioned newly created node has at least the above-mentioned subscription mode; when the above-mentioned newly created node completes registration in the upstream node with which it has an associated relationship based on the subscription mode, in response to the above-mentioned upstream node sending a target message, the above-mentioned newly created node receives the target message through the communication mode corresponding to the above-mentioned upstream node.

[0010] Optionally, the obtaining of the target message includes: Obtain the above user message of the user terminal through the above user layer node; and / or, The second service layer node is used to analyze the user message, generate a control instruction, and perform processing based on the control instruction so that the system layer node obtains a feedback message corresponding to the user message.

[0011] Optionally, the processing based on the control instruction so that the system layer node obtains a feedback message corresponding to the user message includes: Control the real machine and / or read the real machine data based on the control instructions, and generate a feedback message based on the real machine state or the real machine data; The above feedback message is obtained through the above system layer node.

[0012] To achieve the above objective, according to another aspect of an embodiment of the present invention, a message transmission device is provided.

[0013] A message transmission device according to an embodiment of the present invention includes: a push module, which is used to obtain a target message, and use a data push unit to push the target message to a target transmission unit through a push mode; a receiving module, which is used to use the target transmission unit to receive the target message through a push mode; wherein the target message is at least used to represent a user message or a feedback message; a sending module, which is used to switch the target transmission unit from a push mode to a routing mode, so as to send the target message to a scheduling layer node through the routing mode; a distribution module, which is used to distribute the target message to at least one data receiving unit having a routing relationship therewith through a routing mode using the scheduling layer node based on a routing matching rule; and a synchronization module, which is used to switch the data receiving unit from a routing mode to a subscription mode, so as to synchronize the target message to a data subscription unit.

[0014] Optionally, the above device is also used for: When the target message represents the user message, the data push unit is a user layer node, the target transmission unit is a first service layer node downstream of the user layer node, the data receiving unit is a second service layer node downstream of the scheduling layer node, and the data subscription unit is a system layer node; and / or, When the target message represents the feedback message, the data push unit is a system layer node, the target transmission unit is the second service layer node, the data receiving unit is the first service layer node, and the data subscription unit is a user layer node.

[0015] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device for message transmission is provided.

[0016] An electronic device for message transmission according to an embodiment of the present invention comprises: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a message transmission method according to an embodiment of the present invention.

[0017] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided.

[0018] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a message transmission method according to an embodiment of the present invention is implemented.

[0019] An embodiment of the above invention has the following advantages or beneficial effects: the nodes in the distributed network platform are functionally divided to obtain data push units, target transmission units, scheduling layer nodes, data receiving units and data subscription units, and different basic communication modes are integrated into the distributed network platform to form a new communication mode, so that the transmission process of the target message is standardized, avoiding the problem of real-time sharing of messages due to the inconsistent communication modes of each node, and greatly improving the message flow efficiency.

[0020] The target message is obtained through the data push unit, and the target message is transferred to the scheduling layer node through the target transmission unit. Messages with different contents are uniformly scheduled through the scheduling layer node and forwarded to the corresponding data receiving unit with a routing relationship. Then, the message is distributed to the corresponding data subscription unit with a subscription relationship through the subscription mode, so that the data receiving units that monitor the same message content can simultaneously receive the target message forwarded by the scheduling layer node, and the data subscription units that subscribe to the same message content can simultaneously receive the target message distributed by the data receiving unit, thereby realizing the directional and standardized transmission of the target message in the distributed network platform.

[0021] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Figure 1 is a flow chart of a message transmission method according to an embodiment of the present invention; Figure 2 is a schematic diagram of a specific flow of a message transmission method when a target message represents a user message according to an embodiment of the present invention; Figure 3 is a schematic diagram of a specific flow of a message transmission method when a target message represents a feedback message according to an embodiment of the present invention; Figure 4 is a schematic diagram of node expansion according to an embodiment of the present invention; Figure 5 is a flow chart of a message transmission method according to another embodiment of the present invention; Figure 6 A schematic diagram of the structure of a message transmission device implemented according to the present invention; Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied; Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0023] Exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be appreciated by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and simplicity, the description of known functions and structures is omitted in the following description. As used herein, the terms "roughly", "approximately" and similar terms are used as terms of approximation, rather than terms of degree, and are intended to illustrate the inherent deviations in measured values ​​or calculated values ​​that will be recognized by those of ordinary skill in the art. In addition, in the present invention, the order in which the steps are processed and described does not necessarily represent the order in which these processes occur in actual operation, unless otherwise clearly defined or deducible from the context.

[0024] It should be pointed out that, in the absence of conflict, the embodiments and features of the embodiments of the present invention may be combined with each other.

[0025] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.

[0026] Cloud machine is a platform where users can use real mobile devices through online pages or terminal devices. Users can operate mobile phones or perform automated testing tasks in the cloud machine platform. Operating mobile phones through the cloud machine platform requires a large amount of message communication transmission. The ZeroMQ communication library is a high-performance message transmission library that can support multiple communication modes and communication protocols. The message transmission method and device of the present invention use ZeroMQ as the underlying communication library and adopt the integration of multiple basic communication modes based on ZeroMQ to realize real-time communication of multiple messages to adapt to the complex communication scenarios of the cloud machine platform.

[0027] Figure 1 It is a flowchart of a message transmission method according to an embodiment of the present invention.

[0028] like Figure 1 As shown, the message transmission method of the embodiment of the present invention mainly includes the following steps S101 to S105: Step S101, obtaining a target message, and using a data push unit to push the target message to a target transmission unit through a push mode; wherein the target message is at least used to represent a user message or a feedback message; Step S102, using the target transmission unit to receive the target message in a push mode; Step S103, switching the target transmission unit from a push mode to a routing mode, so as to send the target message to a scheduling layer node through the routing mode; Step S104, based on the routing matching rule, the scheduling layer node is used to distribute the target message to at least one data receiving unit having a routing relationship therewith through a routing mode; Step S105, switching the data receiving unit from the routing mode to the subscription mode to synchronize the target message to the data subscription unit.

[0029] When transmitting the target message, the target message can only be transmitted from the sending end to the receiving end of the same basic communication mode, and it is not possible to transmit messages across communication modes. Therefore, after obtaining the target message, the target message is sent to the corresponding data receiving unit and / or data subscription unit through the transmission flow of the target message between nodes with different functions.

[0030] Among them, the push mode is used for message transmission of unidirectional data flow; the routing mode is used for bidirectional message transmission between multiple nodes; and the subscription mode is used for message transmission from one node to multiple subscription nodes that have subscribed to the corresponding message content.

[0031] The target message can represent a user message or a feedback message. A user message is a message generated by the user end, which needs to be sent to the data receiving unit for business processing and sent to the data subscription unit of the user message for message notification and sharing; a feedback message is a message generated after business processing based on the user message after receiving the user message, which needs to be sent to the data subscription unit of the feedback message to realize message feedback and sharing.

[0032] In an optional embodiment, when the target message represents the user message, the data push unit is a user layer node, the target transmission unit is a first service layer node downstream of the user layer node, the data receiving unit is a second service layer node downstream of the scheduling layer node, and the data subscription unit is a system layer node; The user layer node pushes the user message to the first service layer node downstream thereof through the push mode, so that the first service layer node receives the user message through the push mode; Switching the first service layer node from the push mode to the routing mode to send the user message to the scheduling layer node through the routing mode; Based on the routing matching rule, the scheduling layer node is used to distribute the user message to at least one of the second service layer nodes having a routing relationship therewith through a routing mode; The second business layer node is switched from the routing mode to the subscription mode to synchronize the user message to the system layer node.

[0033] Furthermore, the sending end of the push mode is a unidirectional data sending end (push end), and the receiving end is a unidirectional data receiving end (pull end); the sending end of the routing mode is a bidirectional data forwarding end (router end), and the receiving end is a bidirectional data receiving end (dealer end); the sending end of the subscription mode is an information publishing end (pub end), and the receiving end is an information receiving end (sub end).

[0034] like Figure 2 As shown, when the target message represents a user message, the user message needs to be sent from the user layer node to the system layer node. A unidirectional data sending terminal is deployed in the user layer node; a unidirectional data receiving terminal and a bidirectional data receiving terminal are deployed in the first business layer node; a bidirectional data forwarding terminal is deployed in the scheduling layer node; a bidirectional data receiving terminal and a first information publishing terminal are deployed in the second business layer node; and a first information receiving terminal is deployed in the system layer node.

[0035] Specifically, after the user layer node obtains the user message, based on the push mode, the push end of the user layer node is used to push the user message to the first business layer node downstream thereof, so that the pull end of the first business layer node receives the user message; the first business layer node that receives the user message is switched to the routing mode, and the dealer end is used to send the user message to the scheduling layer node, so that the scheduling layer node receives the user message through the router end; based on the routing matching rule, the scheduling layer node is used to forward the user message to at least one second business layer node with a routing relationship through the router end, so that the second business layer node receives the user message through the dealer end; the second business layer node is switched from the routing mode to the subscription mode, and the first pub end of the second business layer node is used to synchronize the user message to the system layer node, so that the system layer node receives the user message through the first sub end. Through the above process, the data flow and message transmission of the user message from the user side to the system side are realized.

[0036] Among them, the switching between different communication modes is mainly based on the underlying protocol of the ZeroMQ communication library. During the switching process, the ZeroMQ communication library automatically changes the message format, while the message content does not change.

[0037] There are communication channels between multiple scheduling layer nodes and multiple data receiving units. When the scheduling layer node is used to forward the message to the data receiving unit, the target messages with different contents correspond to different data receiving units. The data receiving unit is used to continuously monitor the target message from the scheduling layer node based on the route matching rule preset in its execution code. When the content of the target message matches the content specified by the route matching rule, the communication channel between the scheduling layer node and itself is opened to receive the target message; when the content of the target message does not match the content specified in the route matching rule, the communication channel continues to be closed, thereby realizing the directional forwarding of target messages with different contents.

[0038] There is also a communication channel between each data receiving unit and multiple data subscription units. In the process of using the data receiving unit to distribute the target message to the data subscription unit, the data receiving unit distributes the target message to the corresponding data subscription unit through the subscription mode based on the event content subscribed by each data subscription unit.

[0039] In an optional embodiment, when the target message represents the feedback message, the data push unit is a system layer node, the target transmission unit is the second service layer node, the data receiving unit is the first service layer node, and the data subscription unit is a user layer node; The system layer node is used to push the feedback message to the downstream second business layer node through the push mode, so that the second business layer node receives the feedback message through the push mode; Switching the second service layer node from the push mode to the routing mode to send the feedback message to the scheduling layer node through the routing mode; Based on the routing matching rule, the scheduling layer node distributes the feedback message to at least one of the first service layer nodes having a routing relationship therewith through a routing mode; The first service layer node is switched from the routing mode to the subscription mode to synchronize the feedback message to the user layer node.

[0040] like Figure 3 As shown, when the target message represents a feedback message, the feedback message needs to be sent from the system layer node to the user layer node. A unidirectional data sending terminal is deployed in the system layer node; a unidirectional data receiving terminal and a bidirectional data receiving terminal are deployed in the second business layer node; a bidirectional data forwarding terminal is deployed in the scheduling layer node; a bidirectional data receiving terminal and a first information publishing terminal are deployed in the first business layer node; and a first information receiving terminal is deployed in the user layer node.

[0041] Specifically, after the system layer node obtains the feedback message, based on the push mode, the push end of the system layer node is used to push the feedback message to the second business layer node downstream thereof, so that the pull end of the second business layer node receives the feedback message; the second business layer node that receives the feedback message is switched to the routing mode, and the dealer end is used to send the feedback message to the scheduling layer node, so that the scheduling layer node receives the feedback message through the router end; based on the routing matching rule, the scheduling layer node is used to forward the feedback message to at least one first business layer node with a routing relationship through the router end, so that the first business layer node receives the feedback message through the dealer end; the first business layer node is switched from the routing mode to the subscription mode, and the first pub end of the first business layer node is used to synchronize the feedback message to the system layer node, so that the system layer node receives the feedback message through the first sub end. The above process realizes the message transmission of the feedback message from the system side to the user side.

[0042] In an optional embodiment, when there is a newly created node, the newly created node is registered in an upstream node associated with the newly created node based on a subscription mode; Among them, the above-mentioned newly created node has at least the above-mentioned subscription mode; when the above-mentioned newly created node completes registration in the upstream node with which it has an associated relationship based on the subscription mode, in response to the above-mentioned upstream node sending a target message, the above-mentioned newly created node receives the target message through the communication mode corresponding to the above-mentioned upstream node.

[0043] When a new node of a data push unit, a target transmission unit, a scheduling layer node, a data receiving unit or a data subscription unit is created, a second pub end is deployed in the new node, so that the new node communicates with the second sub end existing in the existing node through a subscription mode, thereby realizing dynamic expansion of nodes supported by a distributed network platform through a subscription mode.

[0044] like Figure 4 As shown, a second pub end and a second sub end for node registration communication are deployed in the newly built node, wherein the second pub end is used to communicate and connect with each existing upstream node, and the second sub end is used to wait for the communication connection of its downstream node. The upstream node is an existing node that has an association relationship with the newly built node, and the association relationship may at least include a routing relationship, a subscription relationship, and a push relationship. Specifically, when a new node is built, a communication connection is established with the second sub end of the upstream node through the second pub end of the newly built node based on the subscription mode, and a target message representing the online launch of the newly built node is published. In response to the upstream node receiving the target message representing the online launch of the newly built node, a communication connection is established with the second pub end of the newly built node through the second sub end of the upstream node, and at the same time, a communication channel of the corresponding communication mode is established based on the association relationship to complete the registration of the newly built node in the upstream node. Afterwards, when the upstream node sends a target message representing a user message or a feedback message through a push mode, a routing mode, or a subscription mode, the newly built node is used to receive the target message through the communication mode corresponding to the upstream node.

[0045] Furthermore, the second pub end and the second sub end used for node registration communication can also be used for node deregistration communication. Specifically, when performing node deregistration of a data push unit, a target transmission unit, a scheduling layer node, a data receiving unit or a data subscription unit, a target message representing that the node to be deregistered is about to go offline is sent to an upstream node with which it has an associated relationship through the second pub end of the node to be deregistered, and in response to the upstream node receiving the target message representing that the node to be deregistered is about to go offline, the communication connection with the second pub end of the node to be deregistered is disconnected through the second sub end of the upstream node, and at the same time, the communication channel of the corresponding communication mode is disconnected based on the associated relationship to complete the deregistration of the node to be deregistered in the upstream node. For the downstream node of the node to be deregistered, in response to the abnormality of its connection with the node to be deregistered, the communication channel of the corresponding communication mode is disconnected based on the associated relationship to complete the deregistration of the node to be deregistered in the downstream node.

[0046] The ZeroMQ communication library itself supports scalability, but cannot realize the automatic registration of newly created nodes and the automatic release of nodes to be deregistered. The present invention realizes the automatic registration of newly created nodes in their upstream nodes and the automatic release when the nodes are deregistered by deploying the second pub terminal and the second sub terminal in the newly created nodes.

[0047] In an optional embodiment, the acquiring the target message includes: The user message of the user terminal is obtained through the user layer node.

[0048] The target message can be used to characterize the user message. Among them, the user message is a message generated by the user terminal. The user message generated by the user terminal is obtained through the user layer node to send the user message to the corresponding second business layer node and system layer node. The user message can represent at least one of the control message and query message sent by the user through the user terminal. As an example, the control message can be a message generated by the user through the user terminal to control the real machine to run a certain software, and the query message can be a message generated by the user through the user terminal to read the running data of a certain software in the real machine. Here, the real machine refers to the real machine in the cloud, that is, the cloud real machine.

[0049] In an optional embodiment, the acquiring the target message includes: The second service layer node is used to analyze the user message, generate a control instruction, and perform processing based on the control instruction so that the system layer node obtains a feedback message corresponding to the user message.

[0050] Feedback messages are messages generated based on real machine status or real machine data. When a real machine responds to a user message, a feedback message is generated based on the real machine status or real machine data, and the feedback message is obtained through the system layer node to send the feedback message to the corresponding user layer node.

[0051] In an optional embodiment, the data processing based on the control instruction so that the system layer node obtains a feedback message corresponding to the user message includes: Control the real machine and / or read the real machine data based on the control instructions, and generate a feedback message based on the real machine state or the real machine data; The above feedback message is obtained through the above system layer node.

[0052] The second business layer node receives the user message and generates a control instruction based on the user message. At the same time, the second business layer node is used to distribute the user message to the system layer node based on the content of the user message for message sharing. The real machine is controlled and / or the data of the real machine is read according to the above control instruction. After the operation is completed, a feedback message is generated based on the real machine status or real machine data.

[0053] The following is a detailed description of the message transmission method in the cloud real machine platform through a specific embodiment: As a distributed network platform, the cloud real machine platform divides the nodes into user layer nodes, first business layer nodes, scheduling layer nodes, second business layer nodes and system layer nodes. Among them, the first business layer node and the second business layer node can be the same business layer node. The corresponding sending end and receiving end are deployed in each node respectively. Specifically, the one-way data sending end and the first information receiving end are deployed in the user layer node; the one-way data receiving end, the first information publishing end and the two-way data receiving end are deployed in the first business layer node and the second business layer node; the two-way data forwarding end is deployed in the scheduling layer node; and the one-way data sending end and the first information receiving end are deployed in the system layer node.

[0054] Through the above deployment, different communication modes exist for each node. User layer nodes have push mode and subscription mode; first business layer nodes and second business layer nodes have push mode, subscription mode and routing mode; scheduling layer nodes have routing mode, thus integrating different basic communication modes into the cloud real machine platform.

[0055] like Figure 5 As shown, in the message transmission process, the user message generated by the user end is obtained, and based on the push mode, the push end of the user layer node is used to push the user message to the first business layer node downstream thereof, so that the pull end of the first business layer node receives the user message; the first business layer node that receives the user message is switched to the routing mode, and the dealer end is used to send the user message to the scheduling layer node, so that the scheduling layer node receives the user message through the router end; based on the routing matching rule, the scheduling layer node is used to forward the user message to at least one second business layer node with a routing relationship through the router end, so that the second business layer node receives the user message through the dealer end; the second business layer node is switched from the routing mode to the subscription mode, and the first pub end of the second business layer node is used to synchronize the user message to the system layer node, so that the system layer node receives the user message through the first sub end. After the second business layer node receives the user message, the second business layer node is used to analyze the user message and generate a control instruction. When the control instruction represents the control of the real machine, opening and running a certain software, the real machine is operated based on the control instruction, and at the same time, a feedback message is generated based on the state of the real machine after the operation.

[0056] After the system layer node obtains the feedback message, based on the push mode, the push end of the system layer node is used to push the feedback message to the second business layer node downstream thereof, so that the pull end of the second business layer node receives the feedback message; the second business layer node that receives the feedback message is switched to the routing mode, and the dealer end is used to send the feedback message to the scheduling layer node, so that the scheduling layer node receives the feedback message through the router end; based on the routing matching rule, the scheduling layer node is used to forward the feedback message to at least one first business layer node with which it has a routing relationship through the router end, so that the first business layer node receives the feedback message through the dealer end; the first business layer node is switched from the routing mode to the subscription mode, and the first pub end of the first business layer node is used to synchronize the feedback message to the system layer node, so that the system layer node receives the feedback message through the first sub end.

[0057] Through the above message transmission process, the user messages in the cloud real machine platform are transmitted from the user layer nodes to the system layer nodes, feedback messages are generated according to the user messages, and the message transmission process of the feedback messages from the system layer node transmission point to the user layer node is realized.

[0058] In the message transmission method of the embodiment of the present invention, the cloud real machine platform, as a distributed network platform, functionally divides the nodes therein to obtain data push units, target transmission units, scheduling layer nodes, data receiving units and data subscription units. By deploying corresponding sending ends and receiving ends in each node, different basic communication modes are integrated in the distributed network platform to form a new communication mode, which standardizes the transmission process of the target message, avoids the problem of inability to share messages in real time due to the inconsistent communication modes of each node, and greatly improves the message flow efficiency.

[0059] The target message is obtained through the data push unit, and the target message is transferred to the scheduling layer node through the target transmission unit. Messages with different contents are uniformly scheduled through the scheduling layer node and forwarded to the corresponding data receiving unit with routing relationship. Then, the message is distributed to the corresponding data subscription unit with subscription relationship through the subscription mode, so that the data receiving units listening to the same message content can simultaneously receive the target message forwarded by the scheduling layer node, and the data subscription units subscribed to the same message content can simultaneously receive the target message distributed by the data receiving unit, realizing the directional and standardized transmission of the target message in the distributed network platform, meeting the complex message transmission scenarios and frequent and large-scale data interactions under the cloud real machine platform, and improving the reliability of the distributed network platform.

[0060] When creating and deregistering nodes, the second information publishing terminal and the second information receiving terminal deployed in the node allow the newly created node to automatically register with its upstream node, and the node to be deregistered can automatically deregister with its upstream node, thereby realizing dynamic expansion and automatic release of nodes based on the subscription model, and improving the disaster recovery capability of the distributed network platform.

[0061] Figure 6 4 is a schematic diagram of main modules of a message transmission device according to an embodiment of the present invention.

[0062] like Figure 6 As shown, the message transmission device 600 of the embodiment of the present invention includes: The push module 601 is used to obtain a target message and push the target message to a target transmission unit through a push mode using a data push unit; The receiving module 602 is used to receive the target message through the push mode by using the target transmission unit; wherein the target message is at least used to represent the user message or the feedback message; The sending module 603 is used to switch the target transmission unit from the push mode to the routing mode, so as to send the target message to the scheduling layer node through the routing mode; A distribution module 604 is used to distribute the target message to at least one data receiving unit having a routing relationship therewith by using the scheduling layer node through a routing mode based on a routing matching rule; The synchronization module 605 is used to switch the data receiving unit from the routing mode to the subscription mode to synchronize the target message to the data subscription unit.

[0063] In an optional embodiment of the present invention, the message transmission device 600 is further used for: When the target message represents the user message, the data push unit is a user layer node, the target transmission unit is a first service layer node downstream of the user layer node, the data receiving unit is a second service layer node downstream of the scheduling layer node, and the data subscription unit is a system layer node; The user layer node pushes the user message to the first service layer node downstream thereof through the push mode, so that the first service layer node receives the user message through the push mode; Switching the first service layer node from the push mode to the routing mode to send the user message to the scheduling layer node through the routing mode; Based on the routing matching rule, the scheduling layer node is used to distribute the user message to at least one of the second service layer nodes having a routing relationship therewith through a routing mode; The second business layer node is switched from the routing mode to the subscription mode to synchronize the user message to the system layer node.

[0064] In an optional embodiment of the present invention, the message transmission device 600 is further used for: When the target message represents the feedback message, the data push unit is a system layer node, the target transmission unit is the second service layer node, the data receiving unit is the first service layer node, and the data subscription unit is a user layer node; The system layer node is used to push the feedback message to the downstream second business layer node through the push mode, so that the second business layer node receives the feedback message through the push mode; Switching the second service layer node from the push mode to the routing mode to send the feedback message to the scheduling layer node through the routing mode; Based on the routing matching rule, the scheduling layer node distributes the feedback message to at least one of the first service layer nodes having a routing relationship therewith through a routing mode; The first service layer node is switched from the routing mode to the subscription mode to synchronize the feedback message to the user layer node.

[0065] In an optional embodiment of the present invention, when there is a newly created node, the message transmission device 600 is further used to register the newly created node in an upstream node associated with the newly created node based on a subscription mode; Among them, the above-mentioned newly created node has at least the above-mentioned subscription mode; when the above-mentioned newly created node completes registration in the upstream node with which it has an associated relationship based on the subscription mode, in response to the above-mentioned upstream node sending a target message, the above-mentioned newly created node receives the target message through the communication mode corresponding to the above-mentioned upstream node.

[0066] In an optional embodiment of the present invention, the push module 601 is further used to: obtain the user message of the user terminal through the user layer node; and / or, The second service layer node is used to analyze the user message, generate a control instruction, and perform processing based on the control instruction so that the system layer node obtains a feedback message corresponding to the user message.

[0067] In an optional embodiment of the present invention, the push module 601 is further used to: control the real machine and / or read the real machine data based on the control instructions, generate a feedback message based on the real machine status or the real machine data; and obtain the feedback message through the system layer node.

[0068] In the message transmission device of the embodiment of the present invention, the cloud real machine platform, as a distributed network platform, functionally divides the nodes therein to obtain data push units, target transmission units, scheduling layer nodes, data receiving units and data subscription units. By deploying corresponding sending ends and receiving ends in each node, different basic communication modes are integrated in the distributed network platform to form a new communication mode, which standardizes the transmission process of the target message, avoids the problem of inability to share messages in real time due to the inconsistent communication modes of each node, and greatly improves the message flow efficiency.

[0069] The target message is obtained through the data push unit, and the target message is transferred to the scheduling layer node through the target transmission unit. Messages with different contents are uniformly scheduled through the scheduling layer node and forwarded to the corresponding data receiving unit with routing relationship. Then, the message is distributed to the corresponding data subscription unit with subscription relationship through the subscription mode, so that the data receiving units listening to the same message content can simultaneously receive the target message forwarded by the scheduling layer node, and the data subscription units subscribed to the same message content can simultaneously receive the target message distributed by the data receiving unit, realizing the directional and standardized transmission of the target message in the distributed network platform, meeting the complex message transmission scenarios and frequent and large-scale data interactions under the cloud real machine platform, and improving the reliability of the distributed network platform.

[0070] Figure 7 An exemplary system architecture 700 is shown to which the message transmission method and the message transmission apparatus according to the embodiments of the present invention can be applied.

[0071] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0072] The user can use the terminal devices 701, 702, 703 to interact with the server 705 through the network 704 to receive or send data, etc. Various communication client applications can be installed on the terminal devices 701, 702, 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0073] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0074] The server 705 may be a server that provides various services, such as a background management server that receives user messages generated and sent by users using the terminal devices 701, 702, and 703. The background management server may transmit the received user messages in various nodes of the distributed network platform, and finally send the user messages to the system layer nodes.

[0075] It should be noted that the message transmission method provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the message transmission system is generally set in the server 705 .

[0076] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0077] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention. Figure 8 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0078] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0079] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0080] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.

[0081] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0082] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0083] The nodes involved in the embodiments of the present invention may be implemented by software or hardware. The nodes described may also be set in a processor. For example, they may be described as: a processor including a push module, a receiving module, a sending module, a distribution module, and a synchronization module. The names of these nodes do not, in some cases, constitute a limitation on the module itself. For example, a push module may be described as a "module that obtains a target message and uses a data push unit to push the target message to a target transmission unit through a push mode."

[0084] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining a target message, and using a data push unit to push the target message to a target transmission unit through a push mode; wherein the target message is at least used to represent a user message or a feedback message; using the above target transmission unit to receive the target message through a push mode; switching the above target transmission unit from a push mode to a routing mode to send the target message to a scheduling layer node through the routing mode; based on a routing matching rule, using the above scheduling layer node to distribute the target message to at least one data receiving unit having a routing relationship with it through a routing mode; switching the above data receiving unit from a routing mode to a subscription mode to synchronize the target message to a data subscription unit.

[0085] In the technical solution of the present invention, the cloud real machine platform, as a distributed network platform, functionally divides the nodes therein to obtain data push units, target transmission units, scheduling layer nodes, data receiving units and data subscription units. By deploying corresponding sending ends and receiving ends in each node, different basic communication modes are integrated in the distributed network platform to form a new communication mode, which standardizes the transmission process of the target message, avoids the problem of real-time sharing of messages due to the inconsistent communication modes of each node, and greatly improves the message flow efficiency.

[0086] The target message is obtained through the data push unit, and the target message is transferred to the scheduling layer node through the target transmission unit. Messages with different contents are uniformly scheduled through the scheduling layer node and forwarded to the corresponding data receiving unit with routing relationship. Then, the message is distributed to the corresponding data subscription unit with subscription relationship through the subscription mode, so that the data receiving units listening to the same message content can simultaneously receive the target message forwarded by the scheduling layer node, and the data subscription units subscribed to the same message content can simultaneously receive the target message distributed by the data receiving unit, realizing the directional and standardized transmission of the target message in the distributed network platform, meeting the complex message transmission scenarios and frequent and large-scale data interactions under the cloud real machine platform, and improving the reliability of the distributed network platform.

[0087] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A message transmission method, characterized in that: include: Acquire a target message, and use a data push unit to push the target message to a target transmission unit through a push mode; wherein the target message is at least used to represent a user message or a feedback message; Using the target transmission unit to receive the target message in a push mode; Switching the target transmission unit from a push mode to a routing mode, so as to send the target message to a scheduling layer node through the routing mode; Based on the routing matching rule, the scheduling layer node is used to distribute the target message to at least one data receiving unit having a routing relationship therewith through a routing mode; The data receiving unit is switched from a routing mode to a subscription mode to synchronize the target message to the data subscription unit.

2. The message transmission method according to claim 1, characterized in that: When the target message represents the user message, the data push unit is a user layer node, the target transmission unit is a first service layer node downstream of the user layer node, the data receiving unit is a second service layer node downstream of the scheduling layer node, and the data subscription unit is a system layer node; The user layer node pushes the user message to the first service layer node downstream thereof through the push mode, so that the first service layer node receives the user message through the push mode; Switching the first service layer node from the push mode to the routing mode, so as to send the user message to the scheduling layer node through the routing mode; Based on the routing matching rule, the scheduling layer node is used to distribute the user message to at least one of the second service layer nodes having a routing relationship therewith through a routing mode; The second service layer node is switched from the routing mode to the subscription mode to synchronize the user message to the system layer node.

3. The message transmission method according to claim 2, characterized in that: When the target message represents the feedback message, the data push unit is a system layer node, the target transmission unit is the second service layer node, the data receiving unit is the first service layer node, and the data subscription unit is a user layer node; Using the system layer node to push the feedback message to a second service layer node downstream thereof through the push mode, so that the second service layer node receives the feedback message through the push mode; Switching the second service layer node from the push mode to the routing mode, so as to send the feedback message to the scheduling layer node through the routing mode; Based on the routing matching rule, the scheduling layer node distributes the feedback message to at least one of the first service layer nodes having a routing relationship therewith through a routing mode; The first service layer node is switched from the routing mode to the subscription mode to synchronize the feedback message to the user layer node.

4. The message transmission method according to any one of claims 2 or 3, characterized in that: When there is a newly created node, the newly created node is registered in an upstream node associated with the newly created node based on a subscription mode; Among them, the newly created node has at least the subscription mode; when the newly created node completes registration in the upstream node with which it has an associated relationship based on the subscription mode, in response to the upstream node sending a target message, the newly created node receives the target message through the communication mode corresponding to the upstream node.

5. The message transmission method according to claim 3, characterized in that: The obtaining of the target message comprises: Acquire the user message of the user terminal through the user layer node; and / or, The second business layer node is used to analyze the user message, generate a control instruction, and perform processing based on the control instruction so that the system layer node obtains a feedback message corresponding to the user message.

6. The message transmission method according to claim 5, characterized in that: The processing based on the control instruction so that the system layer node obtains a feedback message corresponding to the user message includes: Controlling the real machine and / or reading the real machine data based on the control instruction, and generating a feedback message based on the real machine state or the real machine data; The feedback message is obtained through the system layer node.

7. A message transmission device, characterized in that: include: A push module, used to obtain a target message, and use a data push unit to push the target message to a target transmission unit through a push mode; A receiving module, configured to receive the target message through a push mode using the target transmission unit; wherein the target message is at least used to represent a user message or a feedback message; A sending module, used to switch the target transmission unit from a push mode to a routing mode, so as to send the target message to a scheduling layer node through the routing mode; A distribution module, configured to distribute the target message to at least one data receiving unit having a routing relationship therewith by using the scheduling layer node through a routing mode based on a routing matching rule; The synchronization module is used to switch the data receiving unit from a routing mode to a subscription mode to synchronize the target message to the data subscription unit.

8. The message transmission device according to claim 7, characterized in that: The device is also used for: When the target message represents the user message, the data push unit is a user layer node, the target transmission unit is a first service layer node downstream of the user layer node, the data receiving unit is a second service layer node downstream of the scheduling layer node, and the data subscription unit is a system layer node; and / or, When the target message represents the feedback message, the data push unit is a system layer node, the target transmission unit is the second service layer node, the data receiving unit is the first service layer node, and the data subscription unit is a user layer node.

9. An electronic device for message transmission, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.