Information transmission method, device and system

By acquiring environmental parameters in real time to control the node cluster for end-to-end information transmission or switching to the message middleware communication link, the problem of inflexible processing methods in existing technologies is solved, and efficient information transmission in different environments is achieved.

CN112988411BActive Publication Date: 2024-11-19GUANGZHOU SANQI MUTUAL ENTERTAINMENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110133176.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-29
Publication Date
2024-11-19
Estimated Expiration
2041-01-29

AI Technical Summary

Technical Problem

In existing technologies for message-driven application development, messages must be cached through an intermediate message queue, which is not flexible enough and cannot meet the business needs of different environments.

Method used

By acquiring current environmental parameters in real time, the system controls the node cluster to perform end-to-end information transmission when the preset conditions are met; otherwise, it switches to the message middleware communication link for transmission. The communication link is determined by hash partitioning or Round-robin partitioning strategy, and the RSocket protocol and unified API are used to achieve flexibility and efficiency in information transmission between nodes.

Benefits of technology

It enables flexible processing to meet business needs in different environments, improves information transmission efficiency, reduces message middleware load, avoids transmission failures, and enhances message transmission efficiency between nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112988411B_ABST
    Figure CN112988411B_ABST
Patent Text Reader

Abstract

The present application discloses an information transmission method, device and system, the method comprising: obtaining current environmental parameters in real time; when the current environmental parameters meet a first preset condition, controlling each node in a node cluster to perform end-to-end information transmission through a communication link between each of the nodes, wherein each of the nodes includes at least a production node and a consumption node; when the current environmental parameters do not meet the first preset condition, switching each of the nodes to a communication link with a message middleware, and performing information transmission between each of the nodes through the message middleware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an information transmission method, device and system. Background Art

[0002] In the process of message-driven application development, it is usually necessary to realize message production and consumption through several production nodes, several consumption nodes and message queues to complete application development. Among them, the production node is the node responsible for sending messages to the message queue, the consumption node is the node that obtains messages from the message queue, and the message queue is the message middleware used to store information. Since the message queue can be used to store information, no matter how fast the producer generates information, the normal operation of the background program can be guaranteed through the cache of the intermediate message queue. However, when the above system is used for message-driven application development, since all messages must be cached through the intermediate message queue first, the processing method is not flexible enough, and it is only suitable for businesses that need to integrate heavyweight centralized services, and cannot meet business needs in different environments. Summary of the invention

[0003] The purpose of this application is to solve at least one of the technical problems existing in the prior art and to provide an information transmission method, device and system that can improve business processing efficiency while meeting business needs at any time.

[0004] The present application provides an information transmission method, including:

[0005] Get current environmental parameters in real time;

[0006] When the current environmental parameter meets the first preset condition, each node in the control node cluster performs end-to-end information transmission through the communication link between each node, wherein each node includes at least a production node and a consumption node;

[0007] When the current environmental parameter does not meet the first preset condition, each of the nodes is switched to a communication link with a message middleware, and information transmission between the nodes is performed through the message middleware.

[0008] Furthermore, each node in the control node cluster performs end-to-end information transmission through a communication link between the nodes, including:

[0009] The production node is controlled to provide corresponding information to each of the consumption nodes according to the partition to which the communication link between the production node and each of the consumption nodes belongs.

[0010] Furthermore, the partition is determined by a hash partition strategy or a Round-robin partition strategy.

[0011] Further, the production node includes a first node, and the consumption node includes a second node and a third node;

[0012] Each node in the control node cluster performs end-to-end information transmission through a communication link between the nodes, including:

[0013] Control the second node to receive the original information sent by the first node through the communication link with the first node, so that the second node sends the subscription information generated after consuming the original information to the third node, and the original information is generated by the first node according to the consumption request of the third node.

[0014] Further, so that the second node sends the subscription information generated after consuming the original information to the third node, including:

[0015] Control the second node to receive the consumption request of the third node through the communication link with the third node, so that the second node consumes the original information according to the matching result between the consumption request and the original information, generates the subscription information and sends it to the third node.

[0016] Furthermore, the switching of each of the nodes to a communication link with a message middleware, and performing information transmission between the nodes through the message middleware, includes:

[0017] After switching each of the nodes to a communication link with the message middleware, receiving information provided by the production node, and marking the information received from the production node as cache information;

[0018] Detecting information existing in the message middleware, and when detecting that information identical to the cache information does not exist in the message middleware, sending the cache information to the message middleware, so that the message middleware forwards the cache information to the corresponding consumer node.

[0019] Furthermore, the communication protocol between the message middleware and each of the nodes is RSocket.

[0020] Furthermore, each of the nodes uses the same API.

[0021] Furthermore, in an embodiment of the present application, an information transmission device is provided, including:

[0022] Data acquisition module, used to obtain current environmental parameters in real time;

[0023] A first control module, configured to control each node in the node cluster to perform end-to-end information transmission through a communication link between the nodes when the current environmental parameter meets a first preset condition, wherein each node includes at least a production node and a consumption node;

[0024] The second control module is used to switch each of the nodes to a communication link with a message middleware when the current environmental parameter does not meet the first preset condition, and to transmit information between the nodes through the message middleware.

[0025] Furthermore, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the information transmission method as described in the above embodiment is implemented.

[0026] Furthermore, in an embodiment of the present application, an information transmission system is also provided, comprising a plurality of nodes, a message middleware, and the electronic device as described in the above embodiment, wherein each of the nodes comprises at least a production node and a consumption node;

[0027] Each of the nodes is used to perform end-to-end information transmission through the communication link between the nodes when receiving the first control signal of the electronic device; and

[0028] When receiving the second control signal of the electronic device, the communication link with the message middleware is switched to perform information transmission between the nodes through the message middleware.

[0029] Furthermore, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the information transmission method described in the above embodiment.

[0030] Compared with the prior art, the above embodiment obtains the current environmental parameters in real time to determine whether the current environmental parameters meet the first preset conditions. When the current environmental parameters meet the first preset conditions, at least the generating node and the consuming node are controlled to transmit information through the link between the nodes. When the current environmental parameters do not meet the first preset conditions, each node is controlled to realize the message transmission between the nodes through the communication link with the message middleware. This can avoid the need for all messages to be cached through the message queue during the application development process, resulting in an inflexible processing method, and realizes the switching between the centralized transmission of the message middleware and the end-to-end transmission of the node, which can meet the business needs in different environments.

[0031] In the above embodiment, the production node is controlled to provide the consumer node with information corresponding to the partition according to the partition to which the communication link between the production node and the consumer node belongs, thereby providing information corresponding to the communication link as much as possible, which can meet the consumption requirements of the consumer node and improve the efficiency of information transmission.

[0032] The above embodiments use a hash partitioning strategy or a Round-robin partitioning strategy to determine the partition to which the communication link belongs, which can ensure that data is evenly distributed in a predetermined number of partitions, or that the partition allocation is uniform when the subscription information of the partitions is the same.

[0033] In the above embodiment, the second node is controlled to receive the original information sent by the first node and generated according to the consumption request of the third node, and the received original information is consumed to generate subscription information and then sent to the third node, so that the information received by the third node is filtered by the second node, and the desired processed information can be received, thereby meeting the consumption requirements of the third node as a consumption node.

[0034] The above embodiment controls the second node to receive the consumption request of the third node, thereby determining the redundant information that does not match the consumption request and the information that matches the consumption request in the original information, and consumes one of the above information according to the consumption request of the third node, and generates subscription information, so that the redundant information after filtering the original information can be effectively consumed or the information generated according to the consumption request can be accurately determined, thereby reducing the impact on the message transmission of other nodes.

[0035] The above embodiment first receives the information provided by the production node and marks it as cache information, and then detects whether there is information identical to the cache information in the message middleware. If not, the cache information is sent to the message middleware for forwarding to the consumer node. If it exists, the message middleware is controlled to send it directly to the consumer node, thereby minimizing the information load of the message middleware and speeding up the information transmission efficiency in different situations.

[0036] In the above embodiment, the communication protocol between the message middleware and each node adopts RSocket, so that the message middleware and the unified application programming interface in each node can use different underlying transport layers and have different interaction modes, which can better avoid transmission failures caused by differences between the message middleware and the nodes or differences between different nodes.

[0037] In the above embodiment, each node uses the same API, which can improve the efficiency of message transmission between nodes and does not require multiple devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The present application is further described below with reference to the accompanying drawings and embodiments;

[0039] Figure 1 An application environment diagram of an information transmission method in an embodiment;

[0040] Figure 2 is a schematic flow chart of an information transmission method in one embodiment;

[0041] Figure 3 is a schematic diagram of the structure of an information transmission device in one embodiment;

[0042] Figure 4 is a structural block diagram of a computer device in one embodiment;

[0043] Figure 5 Schematic diagram of the structure of an information transmission system in one embodiment. DETAILED DESCRIPTION

[0044] This section will describe in detail the specific embodiments of the present application. The preferred embodiments of the present application are shown in the accompanying drawings. The purpose of the accompanying drawings is to supplement the description of the text part of the specification with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of the present application, but it cannot be understood as a limitation on the scope of protection of the present application.

[0045] In the process of message-driven application development, it is usually necessary to realize message production and consumption through several production nodes, several consumption nodes and message queues to complete application development. Among them, the production node is the node responsible for sending messages to the message queue, the consumption node is the node that obtains messages from the message queue, and the message queue is the message middleware used to store information. Since the message queue can be used to store information, no matter how fast the producer generates information, the normal operation of the background program can be guaranteed through the cache of the intermediate message queue. However, when the above system is used for message-driven application development, since all messages must be cached through the intermediate message queue first, the processing method is not flexible enough, and it is only suitable for businesses that need to integrate heavyweight centralized services, and cannot meet business needs in different environments. Among them, the production node is a computer or computer cluster that generates data or information, and the consumption node is a computer or computer cluster that processes data or information. The message queue is a message middleware that stores data or information, and the message middleware is a computer or computer cluster. When the information provided by the producer is cached through the intermediate message queue, the business needs in different environments have different degrees of emphasis on the intermediate message queue, and it cannot be applied to business needs in different environments.

[0046] In order to solve the above technical problems, Figure 1 FIG. 1 is an application environment diagram of an information transmission method in an embodiment. Figure 1, the information transmission system includes an information transmission device 110, a node 120 and a message middleware 130. The information transmission device 110 is connected to the node 120 through a network, the information transmission device 110 is connected to the message middleware 130 through a network, and the node 120 is connected to the message middleware 130 through a network. The information transmission device 110 can be implemented by an independent computer or a computer cluster composed of multiple computers. Both the node 120 and the message middleware 130 can be implemented by an independent server or a server cluster composed of multiple servers. Among them, the node 120 includes a production node 120 and a consumption node 120. The information transmission device 110 obtains the current environment parameters in real time and determines whether the current environment parameters meet the first preset condition. When the current environment parameters meet the first preset condition, the information transmission device 110 at least controls the generation node 120 and the consumption node 120 to transmit information through the link between the nodes. When the current environment parameters do not meet the first preset condition, the information transmission device 110 controls each node 120 to achieve message transmission between nodes through the communication link with the message middleware 130.

[0047] Below, the information transmission method provided in the embodiments of the present application will be introduced and explained in detail through several specific embodiments.

[0048] like Figure 2 As shown, in one embodiment, an information transmission method is provided. This embodiment mainly uses the method applied to a computer device as an example. The computer device can specifically be the above-mentioned Figure 1 The information transmission device 110 in.

[0049] Reference Figure 2 , the information transmission method specifically includes the following steps:

[0050] S11. Obtain current environmental parameters in real time.

[0051] In this embodiment, the information transmission device obtains the current environment parameter in real time, wherein the current environment parameter is used to determine the business demand in the environment to which the current information transmission system belongs. The current environment parameter can be in the form of one or more parameter items to determine the business demand in the current environment. For example, require=0 indicates that the business demand in the current environment does not need intermediate message pieces, and require=1 indicates that the business demand in the current environment needs intermediate message pieces; or, two parameter items environment and require, when both are 1, indicate that the business demand in the current environment must need intermediate message pieces, when both are 0, indicate that the business demand in the current environment does not need intermediate message pieces, and when one is 1 and the other is 0, indicate that the business demand in the current environment may or may not need intermediate message pieces. The current environment parameter can also directly use the form of an identifier to determine the business demand in the current environment. For example, when the information transmission system has an identifier, such as require-1, it indicates that the business demand in the current environment needs intermediate message pieces. When there is no identifier, it indicates that the business demand in the current environment does not need intermediate message pieces. The current environment parameters can also be directly used in the form of data to determine the business needs in the current environment. For example, the current environment parameter is 3737. Depending on whether the current environment parameter is within the data range where the information transmission system requires message middleware, it can be determined whether the business needs in the current environment of the information transmission system require message middleware.

[0052] In this embodiment, the current environment parameters can be stored in the message middleware, or in one or more nodes, or can be input into the information transmission device, the message middleware or the node by the user. When the current environment parameters are stored in the message middleware or the node, and the business requirements in the environment to which the current information transmission system belongs change, the current user parameters can be changed by automatic matching or manual modification by the user. In addition, for the real-time acquisition method of the current environment parameters, the information transmission device can be used to acquire the current environment parameters at regular intervals, or by collecting the current environment parameters in each time unit within a time period, and using the current environment parameters in the last time unit as the current environment parameters of the time period.

[0053] S12. When the current environmental parameters meet the first preset condition, each node in the control node cluster performs end-to-end information transmission through the communication link between each node, wherein each node includes at least a production node and a consumption node.

[0054] In this embodiment, the information transmission device determines whether the current environmental parameters meet the first preset condition, wherein the first preset condition can be set by the user, or the information transmission device automatically generates. When the current environmental parameters meet the first preset condition, the information transmission device controls each node to perform end-to-end information transmission through the communication link between each node, wherein each node includes at least a production node and a consumption node. The production node is a computer or computer cluster that generates data or information, and the consumption node is a computer or computer cluster that processes data or information. The communication link is a physical channel between two nodes, and the transmission medium of the communication link can be a twisted pair, an optical fiber, or a microwave. The communication link can be a unidirectional communication link or a bidirectional communication link.

[0055] In this embodiment, the production node and the consumption node can be the same node, for example, node 1 and node 2 can both be the production node and the consumption node. Node 1 and node 2 perform end-to-end information transmission through the communication link between the two nodes. When node 1 is a production node and node 2 is a consumption node, node 1 transmits information to node 2 through the communication link between node 2, and node 2 processes the received information; when node 1 is a consumption node and node 2 is a production node, node 2 transmits information to node 1 through the communication link between node 1, and node 1 processes the received information. It is also possible that node 1 receives information transmitted by node 2 through the communication link between node 2 and processes the information, while transmitting information to node 2, and node 2 transmits information to node 1 while receiving information transmitted by node 1 and processing the received information.

[0056] In one embodiment, each node in the control node cluster performs end-to-end information transmission through a communication link between the nodes, including:

[0057] The control production node provides corresponding information to each consumer node according to the partition to which the communication link between the production node and each consumer node belongs.

[0058] In this embodiment, the information transmission device controls the production node to provide each consumer node with information corresponding to the partition to which the communication link between the production node and each consumer node belongs.

[0059] In this embodiment, in order to better store, manage or query the information provided by the production node, the information can be divided into different categories according to the information type, information storage address, information size or information content, and each category corresponds to a different partition. The partition corresponding to the communication link refers to the different information ranges allocated to the communication link so that the communication link between each production node and each consumer node can be efficiently processed or better meet the needs of the consumer node. For example, the information provided by node 1 (production node) includes the recharge information of any game product, wherein the recharge information is divided into category A, category B, category C and category D according to the information size, and the corresponding information sizes of these four categories are 0-1000, 2100-2500, 3100-4000 and 9000-10000 respectively. The partition includes partition a, partition b and partition c, and the information ranges are 0-1000, 1001-2000, and 2001-3000 respectively. For the communication link between node 1 (production node) and node 2 (consumption node), the information of partition a can be efficiently processed. Therefore, according to the information range of partition a, node 1 provides node 2 with the information of category A in the recharge information of any game product. For the communication link between node 1 (production node) and node 3 (consumption node), node 3 wants to process the information of partition c. Therefore, according to the information range of partition c, node 1 provides node 3 with the information of category B in the recharge information of any game product.

[0060] In this embodiment, the production node is controlled to provide the consumer node with information corresponding to the partition according to the partition to which the communication link between the production node and the consumer node belongs, so as to provide information corresponding to the communication link as much as possible, which can meet the consumption requirements of the consumer node and improve the efficiency of information transmission.

[0061] In one embodiment, the partitioning is determined by a hash partitioning strategy or a Round-robin partitioning strategy.

[0062] In this embodiment, the information corresponding to the partition is determined by a hash partition strategy, and the partition corresponding to the communication link can be manually set or automatically matched. By allocating each information to the corresponding partition determined according to the hash value, the first node provides the information in the partition to the corresponding communication link according to the partition matched by the communication link.

[0063] In this embodiment, the hash value of the information can be calculated by a hash algorithm, wherein the hash algorithm can be MD4, MD5, SHA-1, etc. The hash value calculation method and the selection of the hash algorithm are relatively common and will not be described in detail in this embodiment.

[0064] After the hash value is calculated, the corresponding multiple partitions can be determined by hashing, consistent hashing, etc. For example, using the hashing method, there are three partitions in the first node, namely area0, area1, and area2, and there are five pieces of information. The hash values ​​calculated are 247, 760, 903, 533, and 302 respectively. The calculated hash value is modulo the number of partitions N=3, and the remainder indicates which partition the information corresponding to the hash value is in. Therefore, it can be seen that area0 has information corresponding to hash value 903, area1 has information corresponding to 247 and 760, and area2 has information corresponding to 533 and 302.

[0065] In this embodiment, the information corresponding to the partition is determined by the Round-robin partition strategy, and the partition corresponding to the communication link can be manually set or automatically matched. Each piece of information is allocated to the corresponding partition by polling, and the first node then provides the information in the partition to the corresponding communication link according to the partition matched by the communication link. If the information corresponding to the partition is the same, the partition allocation of the Round-robin strategy will be uniform. For example, there are 2 partitions C0 and C1, both corresponding to topics t0 and t1, and each topic has 3 pieces of information, then all the corresponding information can be identified as: t0p0, t0p1, t0p2, t1p0, t1p1, t1p2. The final allocation result is: Partition C0: t0p0, t0p2, t1p1; Partition C1: t0p1, t1p0, t1p2.

[0066] If the information corresponding to the partitions is different, the partition allocation will not be completely round-robin, which may lead to uneven partition allocation. If a partition does not correspond to a topic, then when allocating the partition, this partition will not be allocated any information of this topic.

[0067] For example, there are three partitions C0, C1 and C2, which subscribe to three topics: t0, t1, t2. These three topics have 1, 2, and 3 messages respectively, that is, the three partitions correspond to the six partitions t0p0, t1p0, t1p1, t2p0, t2p1, and t2p2. Specifically, partition C0 corresponds to topic t0, partition C1 corresponds to topics t0 and t1, and partition C2 corresponds to topics t0, t1, and t2. The final allocation result is: partition C0: t0p0; partition C1: t1p0; partition C2: t1p1, t2p0, t2p1, t2p2.

[0068] In this embodiment, a hash partitioning strategy or a Round-robin partitioning strategy is used to determine the partition to which the communication link belongs, which can ensure that data is evenly distributed in a predetermined number of partitions, or that the partition allocation is uniform when the subscription information of the partitions is the same.

[0069] In one embodiment, the production node includes a first node, and the consumption node includes a second node and a third node.

[0070] Each node in the control node cluster performs end-to-end information transmission through the communication link between each node, including:

[0071] The second node is controlled to receive the original information sent by the first node through the communication link with the first node, so that the second node sends the subscription information generated after consuming the original information to the third node. The original information is generated by the first node according to the consumption request of the third node.

[0072] In this embodiment, each node can be a production node or a consumption node. Therefore, when the first node is Figure 1 When the first node is node 1, the second node can be node 2 or node 3, and correspondingly, the third node can be node 3 or node 2. Figure 1 When the first node is node 2, the second node can be node 1 or node 3, and correspondingly, the third node can be node 3 or node 1. Figure 1 When the node is node 3, the second node can be node 1 or node 2, and correspondingly, the third node can be node 2 or node 1.

[0073] In this embodiment, the first node generates original information based on the consumption request of the third node, wherein the original information may only include the original information generated based on the consumption request of the third node or also include the information generated based on the consumption request of other nodes or also include mixed redundant information. The consumption request is the information that the consumption node wants to consume, and the information content, information type, information size, etc. can be specifically limited. The consumption request of the third node can be set manually or the node can be matched and generated by itself. The original information generated based on the consumption request of the third node can be encrypted or format converted or screened according to the information in the consumption request. For example, the first node has login data and recharge data of any game product, and the consumption request of the third node is the data content of login data. At this time, the first node screens out the login data of any game product as the original information and provides it to the communication link between the first node and the second node.

[0074] After the first node generates the original information, it transmits the original information to the second node through the communication link between the first node and the second node. After receiving the original information, the second node consumes the original information and generates subscription information. The original information in the information is consumed, that is, the original information is processed to generate the subscription information. The processing method may be encryption, format conversion or content simplification. For example, the first node provides the original information to the second node through the communication link between the first node and the second node. The original information includes data 1-100. The original information generated according to the consumption request of the third node is also data 1-100. At this time, the second node performs format conversion on the data 1-100, converts the data 1-100 into a hexadecimal representation, obtains the subscription information, and sends the subscription information to the third node through the communication link between the second node and the third node.

[0075] In this embodiment, the second node is controlled to receive the original information sent by the first node based on the consumption request of the third node, and the received original information is consumed to generate subscription information and then sent to the third node, so that the information received by the third node is filtered by the second node, and the desired processed information can be received, thereby meeting the consumption requirements of the third node as a consumption node.

[0076] In one embodiment, the second node sends subscription information generated after consuming the original information to the third node, including:

[0077] The second node is controlled to receive a consumption request from the third node through a communication link with the third node, so that the second node consumes the original information according to a matching result between the consumption request and the original information, and generates subscription information and sends it to the third node.

[0078] In this embodiment, the first node generates original information based on the consumption request of the third node, wherein the original information may only include the original information generated based on the consumption request of the third node or also include the information generated based on the consumption request of other nodes or also include mixed redundant information. The consumption request is the information that the node wants to consume, and the information content, information type, information size, etc. can be specifically limited. The consumption request of the third node can be set manually or the node can be matched and generated by itself. The original information generated based on the consumption request of the third node can be encrypted or format converted or screened according to the information in the consumption request. For example, the first node has login data and recharge data of any game product, and the consumption request of the third node is the data content of login data. At this time, the first node screens out the login data of any game product as the original information and provides it to the communication link between the second node.

[0079] After the first node generates the original information, the information transmission device controls the first node to transmit the original information to the second node through the communication link between the first node and the second node. The second node matches the original information sent by the first node according to the consumption request received by the third node, and the second node consumes the original information according to the matching result of the message request and the original information. Among them, for the second node to match the original information according to the consumption request and consume the original information according to the matching node, it can be determined by matching the information generated according to the consumption request of the third node in the original information sent by the first node, and then determine the redundant information other than the information generated according to the consumption request of the third node, so that the second node consumes the redundant information. It is also possible to determine the information generated according to the consumption request of the third node in the original information sent by the first node through matching, so that the second node consumes the information generated according to the consumption request of the third node. As for the matching method of the second node according to the consumption request and the information generated according to the consumption request of the third node, the information generated according to the consumption request of the third node may include the identifier of the consumption request of the third node. For example, the original information is login data 1-100, and the information generated according to the consumption request of the third node is data 51-100. The format of each data is 51-ysczg, ..., 100-ysczg, and the consumption request is the login data of the Song of Cloud City. Therefore, the second node can identify from the login data 1-100 that the login data 51-100 of the Song of Cloud City is the information generated according to the consumption request.

[0080] In this embodiment, the second node consumes the redundant information in the original information, that is, consumes other information in the original information except the information generated according to the consumption request of the third node, and after consumption, the remaining information generated according to the consumption request of the third node can be converted or not processed to generate subscription information, wherein the second node consumes the redundant information, that is, filters the original information, consumes the redundant information to obtain the information generated according to the consumption request of the third node, specifically processes the redundant information except the information generated according to the consumption request of the third node, converts or does not process the information generated according to the consumption request of the third node, and generates subscription information. For example, the first node provides the original information to the second node through the communication link between the first node and the second node, the original information includes data 1-100, and the information generated according to the consumption request of the third node is data 51-100, so the redundant information of data 1-50 is mixed in the original information, at this time, the second node consumes the 1-50 part of the data 1-100 in the original information, generates the remaining information 51-100 as subscription information after consumption, and sends the subscription information to the third node through the third channel.

[0081] The second node consumes the information generated according to the consumption request of the third node. Specifically, after the second node determines the information generated according to the consumption request of the third node through the matching node, the second node consumes the information generated according to the consumption request of the third node, and generates subscription information after consumption, wherein the way of consuming and generating subscription information can be to encrypt or convert the information. For example, the first node provides original information to the second node through the communication link between the first node and the second node, the original information includes data 1-100, and the information generated according to the consumption request of the third node is data 51-100, so the original information is mixed with redundant information of data 1-50. The second node determines that the 51-100 part of the original information 1-100 is the information generated according to the consumption request according to the matching result. At this time, the second node converts the format of data 51-100, converts the data 51-100 into a hexadecimal representation, obtains subscription information, and sends the subscription information to the third node through the communication link between the first node and the second node.

[0082] In this embodiment, the second node is controlled to receive the consumption request of the third node, thereby determining the redundant information in the original information that does not match the consumption request and the information that matches the consumption request, and consuming one of the above information according to the consumption request of the third node, and generating subscription information, so that the redundant information after filtering the original information can be effectively consumed or the information generated according to the consumption request can be accurately determined, thereby reducing the impact on the message transmission of other nodes.

[0083] S13. When the current environmental parameters do not meet the first preset condition, each node is switched to a communication link with the message middleware, and information is transmitted between the nodes through the message middleware.

[0084] In this embodiment, the information transmission device determines whether the current environmental parameters meet the first preset condition. When the current environmental parameters do not meet the first preset condition, the information transmission device controls each node to disconnect the communication link between each node, and controls each node to transmit information with the message middleware through the communication link between the message middleware. Among them, when there is no communication link between one or more of the nodes and the message middleware, then when the current environmental parameters do not meet the first preset condition, the information transmission device controls the corresponding one or more of the nodes to establish a communication link with the message middleware; when there is a communication link between each node and the message middleware, then when the current environmental parameters do not meet the first preset condition, the information transmission device controls each node to stop transmitting information between each node through the communication link between each node, and controls each node to transmit information with the message middleware through the communication link between the message middleware, so that the production node provides information to the message middleware, and the message middleware forwards the received information to the consumption node.

[0085] The communication link between each node and the message middleware is a physical channel, and the transmission medium of the communication link can be a twisted pair, optical fiber or microwave. The communication link between each node and the message middleware can be a unidirectional communication link or a bidirectional communication link.

[0086] In one embodiment, each node is switched to a communication link with a message middleware, and information transmission between nodes is performed through the message middleware, including:

[0087] After each node is switched to the communication link with the message middleware, the information provided by the production node is received, and the information received from the production node is marked as cache information.

[0088] Detect information existing in the message middleware, and when detecting that information identical to the cached information does not exist in the message middleware, send the cached information to the message middleware, so that the message middleware forwards the cached information to the corresponding consumer node.

[0089] In this embodiment, the information transmission device receives information provided by the production node, and marks the information provided by the generation node as cache information, wherein the marking method can be to mark the information by adding a prefix or suffix, or to add a specific identifier, or to add an identifier to the address or folder where the information is located.

[0090] The information transmission device detects the information existing in the message middleware, wherein the information existing in the message middleware may be information stored in the message middleware, or the information body may be stored in another computer or computer cluster, and the message middleware stores the information of the identification or address of the information. The information transmission device determines whether there is information in the message middleware that is the same as the cached information by comparing the cached information with the information stored in the message middleware. In this embodiment, the comparison method for whether the information is the same is not specifically limited.

[0091] In this embodiment, when the information transmission device detects that there is information identical to the cached information in the message middleware, the information transmission device sends an instruction to the message middleware, so that the message middleware transmits the information identical to the cached information to the corresponding consumer node. The instruction may include the content of the cached information or the identifier of the information identical to the cached information stored in the message middleware. For example, the cached information is the login data of the song of Cloud City, which is identified as login data-ysczg in the message middleware. Then the information transmission device sends the instruction "send-login data-ysczg-node1" to the message middleware, so that the message middleware transmits the stored information identified as login data-ysczg to node node1. Or send the instruction "send-login data of the song of Cloud City" to let the message middleware transmit the information identical to the login data of the song of Cloud City in the message middleware to the corresponding consumer node.

[0092] When the information transmission device detects that there is no cache information in the message middleware, the information transmission device transmits the received cache information to the message middleware, wherein the information transmission device transmits information through the communication link between the information transmission device and the message middleware, and the communication link between the information transmission device and the message middleware can be a unidirectional communication link or a bidirectional communication link. After the message middleware receives the cache information, it forwards the cache information to the corresponding consumer node through the communication link between the node. The corresponding relationship between the cache information and the consumer node can be that the cache information contains the identifier of the consumer node, or the cache information contains the identifier of a specific communication link.

[0093] In one embodiment, the communication protocol between the message middleware and each node is RSocket.

[0094] Among them, RSocket is a protocol of layer 5 / 6 in the OSL seven-layer model, and is an application layer protocol on top of TCP / IP. RSocket can use different underlying transport layers, including TCP, WebSocket, and Aeron. TCP is suitable for interactions between components of a distributed system, WebSocket is suitable for interactions between browsers and servers, and Aeron is a transmission method based on the UDP protocol, which ensures that RSocket can adapt to different scenarios. The application layer implementation using RSocket can remain unchanged, and only needs to select the appropriate underlying transmission method according to the system environment, device capabilities, and performance requirements. As an application layer protocol, RSocket can easily define its own protocol based on it. In addition, RSocket uses a binary format to ensure efficient transmission and save bandwidth. Moreover, through flow control based on reactive stream semantics, RSocket ensures that both parties in the message transmission will not collapse due to excessive pressure of requests, and can model all interactions in the application as network primitives, that is, it can stream data or perform publish / subscribe without setting up application queues.

[0095] In this embodiment, the communication protocol between the message middleware and each node adopts RSocket.

[0096] In this embodiment, the communication protocol between the message middleware and each node adopts RSocket, so that the message middleware and the unified application programming interface in each node can use different underlying transport layers and have different interaction modes, which can better avoid transmission failures caused by differences between the message middleware and the nodes or differences between different nodes.

[0097] In one embodiment, each node uses the same API.

[0098] Among them, API (Application Programming Interface) is some pre-defined interfaces (such as functions, HTTP interfaces), or refers to the agreement for connecting different components of the software system. In this embodiment, the first node, the second node and the third node are all computers or computer clusters, so the specific form of API is the prior art and will not be repeated here. And in this embodiment, there is no specific limitation on API.

[0099] In this embodiment, each node uses the same API, which can improve the efficiency of message transmission between nodes and does not require multiple devices.

[0100] In the above embodiment, by acquiring the current environmental parameters in real time, it is determined whether the current environmental parameters meet the first preset conditions. When the current environmental parameters meet the first preset conditions, at least the generating node and the consuming node are controlled to transmit information through the link between the nodes. When the current environmental parameters do not meet the first preset conditions, each node is controlled to realize the message transmission between the nodes through the communication link with the message middleware. This can avoid the need for all messages to be cached through the message queue during the application development process, resulting in an inflexible processing method, and realize the switching between the centralized transmission of the message middleware and the end-to-end transmission of the node, which can meet the business needs in different environments.

[0101] In one embodiment, Figure 3 As shown, an information transmission device is provided, comprising:

[0102] The data acquisition module 101 is used to acquire current environmental parameters in real time.

[0103] The first control module 102 is used to control each node in the node cluster to perform end-to-end information transmission through the communication link between each node when the current environmental parameter meets the first preset condition, wherein each node includes at least a production node and a consumption node.

[0104] The second control module 103 is used to switch each node to a communication link with the message middleware when the current environmental parameter does not meet the first preset condition, and transmit information between the nodes through the message middleware.

[0105] In one embodiment, the first control module 102 is further used to: control the production node to provide corresponding information to each consumer node according to the partition to which the communication link between the production node and each consumer node belongs.

[0106] In one embodiment, the partitioning is determined by a hash partitioning strategy or a Round-robin partitioning strategy.

[0107] In one embodiment, the production node includes a first node, and the consumption node includes a second node and a third node.

[0108] The first control module 102 is further configured to:

[0109] The second node is controlled to receive the original information sent by the first node through the communication link with the first node, so that the second node sends the subscription information generated after consuming the original information to the third node. The original information is generated by the first node according to the consumption request of the third node.

[0110] In one embodiment, the first control module 102 is further configured to:

[0111] The second node is controlled to receive a consumption request from the third node through a communication link with the third node, so that the second node consumes the original information according to a matching result between the consumption request and the original information, and generates subscription information and sends it to the third node.

[0112] In one embodiment, the second control module 103 is further configured to:

[0113] After each node is switched to the communication link with the message middleware, the information provided by the production node is received, and the information received from the production node is marked as cache information.

[0114] Detect information existing in the message middleware, and when detecting that information identical to the cached information does not exist in the message middleware, send the cached information to the message middleware, so that the message middleware forwards the cached information to the corresponding consumer node.

[0115] In one embodiment, the communication protocol between the message middleware and each node is RSocket.

[0116] In one embodiment, each node uses the same API.

[0117] In one embodiment, a computer device is provided, such as Figure 4 As shown, the computer device includes a processor, a memory, a network interface, an input device and a display screen connected via a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the information transmission method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute the information transmission method. Those skilled in the art can understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0118] In one embodiment, the service scheduling device provided by the present application can be implemented in the form of a computer program. Figure 4 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the service scheduling device. The computer program composed of various program modules enables the processor to execute the steps of the information transmission method of each embodiment of the present application described in this specification.

[0119] In one embodiment, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the above-mentioned information transmission method when executing the program. The steps of the information transmission method here may be the steps of the information transmission method in the above-mentioned various embodiments.

[0120] In one embodiment, Figure 5 As shown, an information transmission system is provided, including multiple nodes, message middleware and the electronic device as described in the above embodiment, each node includes at least a production node and a consumption node.

[0121] Each node is used to perform end-to-end information transmission through the communication link between each node when receiving the first control signal of the electronic device; and,

[0122] When receiving the second control signal of the electronic device, the communication link with the message middleware is switched to perform information transmission between nodes through the message middleware.

[0123] In one embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are used to cause a computer to execute the steps of the above-mentioned information transmission method. The steps of the information transmission method here may be the steps in the information transmission method of each of the above-mentioned embodiments.

[0124] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications are also considered to be within the scope of protection of the present application.

[0125] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

Claims

1. An information transmission method, characterized in that: include: Get current environmental parameters in real time; When the current environmental parameter meets the first preset condition, each node in the control node cluster performs end-to-end information transmission through the communication link between each node, wherein each node includes at least a production node and a consumption node, the production node includes a first node, and the consumption node includes a second node and a third node; the second node is controlled to receive the original information sent by the first node through the communication link with the first node, and the second node is controlled to receive the consumption request of the third node through the communication link with the third node, so as to determine the redundant information that does not match the consumption request and the information that matches the consumption request in the original information, and consume one of the redundant information that does not match the consumption request and the information that matches the consumption request according to the consumption request of the third node, generate subscription information and send it to the third node, and the original information is generated by the first node according to the consumption request of the third node; The original information may include only the original information generated according to the consumption request of the third node, or may also include the information generated according to the consumption request of other nodes, or may also include mixed redundant information. The consumption request is the information to be consumed by the consumption node. The consumption request of the third node may be set manually or generated by the node itself. The original information generated according to the consumption request of the third node may be encrypted, format converted, or screened according to the information in the consumption request. When the current environmental parameter does not meet the first preset condition, each of the nodes is switched to a communication link with a message middleware, and information transmission between the nodes is performed through the message middleware.

2. The information transmission method according to claim 1, characterized in that: Each node in the control node cluster performs end-to-end information transmission through a communication link between the nodes, including: The production node is controlled to provide corresponding information to each of the consumption nodes according to the partition to which the communication link between the production node and each of the consumption nodes belongs.

3. The information transmission method according to claim 2, characterized in that: The partition is determined by a hash partition strategy or a Round-robin partition strategy.

4. The information transmission method according to claim 1, characterized in that: The step of switching each of the nodes to a communication link with a message middleware and transmitting information between the nodes through the message middleware includes: After switching each of the nodes to a communication link with the message middleware, receiving information provided by the production node, and marking the information received from the production node as cache information; Detecting information existing in the message middleware, and when detecting that information identical to the cache information does not exist in the message middleware, sending the cache information to the message middleware, so that the message middleware forwards the cache information to the corresponding consumer node.

5. The information transmission method according to claim 1, characterized in that: The communication protocol between the message middleware and each of the nodes is RSocket.

6. The information transmission method according to claim 1, characterized in that: The API used by each of the nodes is the same.

7. An information transmission device, characterized in that: include: Data acquisition module, used to obtain current environmental parameters in real time; A first control module is used to control each node in the node cluster to perform end-to-end information transmission through the communication link between each node when the current environmental parameter meets the first preset condition, wherein each node includes at least a production node and a consumption node, the production node includes a first node, and the consumption node includes a second node and a third node; control the second node to receive the original information sent by the first node through the communication link with the first node, and control the second node to receive the consumption request of the third node through the communication link with the third node, so as to determine the redundant information that does not match the consumption request and the information that matches the consumption request in the original information, and consume one of the redundant information that does not match the consumption request and the information that matches the consumption request according to the consumption request of the third node, generate subscription information and send it to the third node, and the original information is generated by the first node according to the consumption request of the third node; The original information may include only the original information generated according to the consumption request of the third node, or may also include the information generated according to the consumption request of other nodes, or may also include mixed redundant information. The consumption request is the information to be consumed by the consumption node. The consumption request of the third node may be set manually or generated by the node itself. The original information generated according to the consumption request of the third node may be encrypted, format converted, or screened according to the information in the consumption request. The second control module is used to switch each of the nodes to a communication link with a message middleware when the current environmental parameter does not meet the first preset condition, and to transmit information between the nodes through the message middleware.

8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the information transmission method according to any one of claims 1 to 6 is implemented.

9. An information transmission system, characterized in that: The electronic device comprises a plurality of nodes, a message middleware and the electronic device as claimed in claim 8, wherein each of the nodes comprises at least a production node and a consumption node; Each of the nodes is used to perform end-to-end information transmission through the communication link between the nodes when receiving the first control signal of the electronic device; and, When receiving the second control signal of the electronic device, the communication link with the message middleware is switched to perform information transmission between the nodes through the message middleware.

Citation Information

Patent Citations

  • End-to-end communication method and system for delay tolerant network

    CN108566614A

  • Message processing method and device, storage medium and electronic device

    CN111338814A

  • Message transmission method, system, device, electronic equipment and readable storage medium

    CN111381986A

  • End-to-end publish / subscribe middleware architecture

    US20060149840A1