Inter-node communication method, system, storage medium and electronic device
Through the determination of logical links and communication protocols, data transmission between nodes in multi-node communication systems is realized, which solves the problem of no direct physical connection between nodes. It is suitable for complex topological structures and improves communication efficiency and flexibility.
Patent Information
- Application Number
- CN202211132857.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-09-15
AI Technical Summary
In a multi-node communication system, due to device limitations, there is no unified bus connection between nodes and the topological structure is complex, which makes it difficult to interact between nodes. Especially when there is no direct physical connection between two nodes but communication is required through intermediate nodes. It is difficult for the prior art to realize effective non-network media cross-node communication.
The physical channel between the sending node and the receiving node is determined through a logical link, the target communication protocol is determined according to the data type, and data transmission is carried out through the sub-physical channels in the target physical channel to realize data communication between nodes, which is suitable for any topological structure .
Communication between any node is realized, and data transmission does not require intermediate processes to be considered. It is suitable for inter-node communication of any topological structure, improving communication flexibility and efficiency.
Smart Images

Figure CN115842852B_ABST
Abstract
Description
Background Art
[0002] In a multi-node communication system, due to equipment limitations, all nodes do not have a unified bus connection, but data interaction between nodes is required in business. At this time, there is a topology structure that is, there is no direct physical connection between two nodes, but they can be physically connected through other nodes in the middle, and the physical medium connecting the nodes in the middle is also not unified. Therefore, it is urgent to provide a communication method to realize non-network medium cross-node communication. Summary of the invention
[0003] In order to solve the above technical problems, the present invention provides a method, system, storage medium and electronic device for inter-node communication.
[0004] The technical solution of a node-to-node communication method of the present invention is as follows:
[0005] S1. Determine at least one first physical channel between a sending node and a receiving node according to a logical link;
[0006] S2. Determine a target communication protocol between the first target application and the second target application of the receiving node according to the data type of the data to be transmitted in the first target application of the sending node;
[0007] S3. According to the target communication protocol, determine a target physical channel among all the first physical channels, and send the data to be transmitted to the second target application through each sub-physical channel in the target physical channel to realize data communication between the sending node and the receiving node.
[0008] The beneficial effects of an inter-node communication method of the present invention are as follows:
[0009] The method of the present invention can realize communication between any nodes when the two nodes are physically connected and reachable, and the data transmission does not need to consider the intermediate process; therefore, the method of the present invention can be used for communication between nodes of any topology structure.
[0010] Based on the above solution, the inter-node communication method of the present invention can also be improved as follows.
[0011] Furthermore, at least one intermediate node is included between the sending node and the receiving node; all sub-physical channels include: the physical channel between the sending node, each intermediate node and every two adjacent nodes in the receiving node.
[0012] Furthermore, each data type corresponds to a first communication protocol; before step S2, the method further includes: obtaining at least one first communication protocol between the first target application and the second target application;
[0013] The S2 includes: determining the target communication protocol among all first communication protocols according to the data type of the data to be transmitted.
[0014] Further, the sending node includes: a first application layer, a first protocol layer and a first interface layer; the receiving node includes: a second application layer, a second protocol layer and a second interface layer; the sending of the data to be transmitted to the second target application through each sub-physical channel in the target physical channel includes:
[0015] The first target application sends the data to be transmitted to the first interface layer through the first application layer and the first protocol layer in sequence;
[0016] The first interface layer sends the data to be transmitted to the second interface layer through each sub-physical channel of the target physical channel in sequence;
[0017] When the second interface layer successfully verifies the data to be transmitted, the second interface layer sends the data to be transmitted to the second application through the second protocol layer and the second application layer in sequence to achieve data communication between the sending node and the receiving node.
[0018] Further, any intermediate node includes: an intermediate interface layer and an intermediate protocol layer; the first interface layer sends the data to be transmitted to the second interface layer through each sub-physical channel of the target physical channel in turn, including:
[0019] The first interface layer sends the data to be transmitted to the second interface layer in sequence through the intermediate interface layer and the intermediate protocol layer of the intermediate node corresponding to each sub-physical channel of the target physical channel.
[0020] The technical solution of an inter-node communication system of the present invention is as follows:
[0021] Includes: acquisition module, processing module and operation module;
[0022] The acquisition module is used to: determine at least one first physical channel between the sending node and the receiving node according to the logical link;
[0023] The processing module is used to: determine the target communication protocol between the first target application and the second target application of the receiving node according to the data type of the data to be transmitted in the first target application of the sending node;
[0024] The operation module is used to: determine the target physical channel among all the first physical channels according to the target communication protocol, and send the data to be transmitted to the second target application through each sub-physical channel in the target physical channel to realize data communication between the sending node and the receiving node.
[0025] The beneficial effects of an inter-node communication system of the present invention are as follows:
[0026] The system of the present invention can realize communication between any nodes when the two nodes are physically connected and reachable, and the data transmission does not need to consider the intermediate process; therefore, the system of the present invention can be used for communication between nodes of any topology structure.
[0027] Based on the above solution, the inter-node communication system of the present invention can also be improved as follows.
[0028] Furthermore, at least one intermediate node is included between the sending node and the receiving node; all sub-physical channels include: the physical channel between the sending node, each intermediate node and every two adjacent nodes in the receiving node.
[0029] Further, each data type corresponds to a first communication protocol; before the processing module, it also includes: a pre-processing module;
[0030] The preprocessing module is used to: obtain at least one first communication protocol between the first target application and the second target application;
[0031] The processing module is specifically configured to determine the target communication protocol among all first communication protocols according to the data type of the data to be transmitted.
[0032] A technical solution of a storage medium of the present invention is as follows:
[0033] The storage medium stores instructions, and when a computer reads the instructions, the computer executes the steps of an inter-node communication method of the present invention.
[0034] The technical solution of an electronic device of the present invention is as follows:
[0035] The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the computer is caused to execute the steps of a method for communication between nodes according to the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of a flow chart of a method for communication between nodes according to an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of the principle of a physical channel in an inter-node communication method according to an embodiment of the present invention;
[0038] Figure 3 A schematic diagram of a logic channel in an inter-node communication method according to an embodiment of the present invention;
[0039] Figure 4 An abstract inter-node communication structure diagram in an inter-node communication method according to an embodiment of the present invention;
[0040] Figure 5 A schematic diagram of the communication principle in a method for communicating between nodes according to an embodiment of the present invention;
[0041] Figure 6 The present invention is a schematic diagram of the structure of a method for communication between nodes according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] like Figure 1 As shown, a method for inter-node communication in an embodiment of the present invention includes the following steps:
[0043] S1. Determine at least one first physical channel between a sending node and a receiving node according to a logical link.
[0044] Among them, the logical link is equivalent to the link connecting two nodes.
[0045] Among them, Figure 2 As shown in , a physical channel is an abstraction of a physical connection. The connection medium between nodes is not distinguished. As long as it is a physical connection, it can be called a physical channel. Figure 3 As shown in Figure 1, the logical channel is an abstraction based on the physical channel. The transmission of data from one node to another is defined as a logical channel. The logical channel is the implementation of data communication between any two nodes. To better illustrate the relationship between the physical channel and the logical channel, a complex system is abstracted. Its physical channel and logical channel are as follows: Figure 4 As shown, the physical connection between the four nodes is abstracted into four physical channels, and the connection between node A and node D is abstracted into two logical channels.
[0046] The sending node is equivalent to the sending end of the data, and the receiving node is equivalent to the receiving end of the data. The first physical channel includes: at least one sub-physical channel. For example, physical channels 1-4 are all sub-physical channels, and physical channel 1+physical channel 3 (physical channel 2+physical channel 4) is a first physical channel.
[0047] Specifically, each logical channel between the sending node and the receiving node is determined according to the logical link, the first physical channel is determined according to the logical channel, and each sub-physical channel is determined according to the first physical channel.
[0048] S2. Determine a target communication protocol between the first target application and the second target application of the receiving node according to the data type of the data to be transmitted in the first target application of the sending node.
[0049] Among them, at least one application (app) is included between the sending node and the receiving node. For example, the sending node includes: APP1 and APP3, and the receiving node includes: APP2 and APP4. The first target application is: the application used by the sending node to send data to be transmitted (such as APP1), and the second target application is: the application used by the receiving node to receive data to be transmitted (such as APP2).
[0050] There are multiple communication protocols between the first target application and the second target application.
[0051] It should be noted that the data type or communication protocol mentioned in this embodiment does not refer to an existing protocol, but a user-defined protocol. For example, a control protocol is established between the user's APP1 and APP3, in which APP1 sends instructions to APP3, and APP3 performs specific specified actions, temporarily referred to as communication protocol A; the user adds new functions between APP1 and APP3 during use, and thus another communication protocol is established, for example, the protocol APP1 obtains certain status information from APP3, called communication protocol B; communication protocol A and communication protocol B have different functions and are established at different times. After communication protocol A is debugged, it does not need to be modified; when communication protocol B is added, communication protocol B is re-debugged based on the logical channel, which does not affect the original function and can add new protocol functions.
[0052] It should be noted that multiple communication protocols can be supported between the receiving node and the sending node (logical channel). A logical channel is the communication between two nodes. There may be multiple applications on each node. Therefore, the logical channel supports multiple communication protocols, which can enable multiple applications of one node to communicate with multiple applications of another node, making the communication method more flexible and convenient.
[0053] The target communication protocol is a communication protocol used to transmit data to be transmitted between the first target application and the second target application.
[0054] S3. According to the target communication protocol, determine a target physical channel among all the first physical channels, and send the data to be transmitted to the second target application through each sub-physical channel in the target physical channel to realize data communication between the sending node and the receiving node.
[0055] Among them, one communication protocol corresponds to one logical channel, and each logical channel corresponds to one first physical channel. Assuming that communication protocol A (target communication protocol) corresponds to logical channel a, the first physical channel corresponding to logical channel a includes: physical channel 1 and physical channel 3. Then the sub-physical channels corresponding to the target communication protocol in this embodiment are: physical channel 1 and physical channel 3.
[0056] Preferably, at least one intermediate node is further included between the sending node and the receiving node; and all sub-physical channels include: a physical channel between the sending node, each intermediate node and every two adjacent nodes in the receiving node.
[0057] Specifically, assuming that there is an intermediate node C between the sending node A and the receiving node B, the first physical channel between the sending node and the receiving node includes: physical channel 1 between the sending node A and the intermediate node C, and physical channel 3 between the intermediate node C and the receiving node B.
[0058] Preferably, each data type corresponds to a first communication protocol; and before step S2, the method further includes: obtaining at least one first communication protocol between the first target application and the second target application.
[0059] The first communication protocol is a communication protocol between the first target application and the second target application.
[0060] The S2 includes: determining the target communication protocol among all first communication protocols according to the data type of the data to be transmitted.
[0061] Preferably, the sending node includes: a first application layer, a first protocol layer and a first interface layer; the receiving node includes: a second application layer, a second protocol layer and a second interface layer; the sending of the data to be transmitted to the second target application through each sub-physical channel in the target physical channel includes:
[0062] The first target application sends the data to be transmitted to the first interface layer through the first application layer and the first protocol layer in sequence.
[0063] Among them, each layer of the sending node and the receiving node has its own packet header format.
[0064] It should be noted that the interface layer corresponds to the sending and receiving of the physical channel. The interface layer encapsulates the received data into the interface layer header. When sending data, the physical channel to be used is determined according to the logical channel number issued by the protocol layer. When receiving data, the interface layer header is parsed to verify the data. After the verification, the data content is reported to the protocol layer. Since the interface layer communicates between nodes, a confirmation and retransmission mechanism is added to ensure the correctness and completion of the data. After sending data, the sending node waits for the receiving node to respond. If a positive response is received, the next packet of data is sent. If a negative response is received or no response is received after a timeout, the current packet of data is retransmitted. The receiving node performs verification after receiving the data. The protocol layer corresponds to the logical channel. When sending data, the protocol layer determines the logical channel to be used according to the application layer. When receiving data, the protocol layer header is parsed to determine. The application layer is used to provide APIs to users, and users can call functions to add.
[0065] The first interface layer sends the data to be transmitted to the second interface layer through each sub-physical channel of the target physical channel in sequence.
[0066] Specifically, the first interface layer encapsulates the interface layer protocol header and sends the data to be transmitted to the second interface layer through each target physical channel in sequence. For example, when the first interface layer is connected to physical channel 1 and physical channel 2 in sequence, the first interface layer sends the data to be transmitted to the second interface layer through target physical channel 1 and target physical channel 2 in sequence.
[0067] When the second interface layer successfully verifies the data to be transmitted, the second interface layer sends the data to be transmitted to the second application through the second protocol layer and the second application layer in sequence to achieve data communication between the sending node and the receiving node.
[0068] Specifically, when the second interface layer receives the data to be transmitted, the second interface layer verifies the received data. If the verification is successful, the interface layer encapsulation is unpacked and removed, and the processed data to be transmitted is sent to the second protocol layer; the second protocol layer parses the protocol layer header to obtain the logical channel number, determines the node where the data arrives according to the logical channel number, and sends the data to be transmitted to the second application layer; the second application layer parses the application layer header to obtain the communication protocol number, and determines the distribution of the data to be transmitted to the second application according to the communication protocol number, so as to realize data communication between the sending node and the receiving node.
[0069] Preferably, any intermediate node includes: an intermediate interface layer and an intermediate protocol layer; the first interface layer sends the data to be transmitted to the second interface layer through each sub-physical channel of the target physical channel in turn, including:
[0070] The first interface layer sends the data to be transmitted to the second interface layer in sequence through the intermediate interface layer and the intermediate protocol layer of the intermediate node corresponding to each sub-physical channel of the target physical channel.
[0071] Specifically, Figure 5 As shown, through the determined target physical channel, the first interface layer sends the data to be transmitted to the intermediate interface layer of the corresponding intermediate node. When the intermediate interface layer successfully verifies the received data, it unpacks the data to remove the interface layer encapsulation, and sends the data to be transmitted to the intermediate protocol layer; the intermediate protocol layer parses the protocol layer header to obtain the logical channel number, and determines the data to enter the downlink path and transmit it to the next node (the intermediate interface layer or the second interface layer of the next intermediate node) according to the logical channel number.
[0072] The technical solution of this embodiment can realize communication between any nodes when the two nodes are physically connected and reachable, and the transmission of data does not need to consider the intermediate process; therefore, the method of the present invention can be used for communication between nodes of any topology.
[0073] like Figure 6 As shown, an inter-node communication system 200 according to an embodiment of the present invention includes: an acquisition module 210, a processing module 220 and an operation module 230;
[0074] The acquisition module 210 is used to: determine at least one first physical channel between a sending node and a receiving node according to a logical link;
[0075] The processing module 220 is used to: determine the target communication protocol between the first target application and the second target application of the receiving node according to the data type of the data to be transmitted in the first target application of the sending node;
[0076] The operation module 230 is used to: determine the target physical channel among all the first physical channels according to the target communication protocol, and send the data to be transmitted to the second target application through each sub-physical channel in the target physical channel to realize data communication between the sending node and the receiving node.
[0077] Preferably, at least one intermediate node is further included between the sending node and the receiving node; and all sub-physical channels include: a physical channel between the sending node, each intermediate node and every two adjacent nodes in the receiving node.
[0078] Preferably, each data type corresponds to a first communication protocol; before the processing module 220, it also includes: a pre-processing module;
[0079] The preprocessing module is used to: obtain at least one first communication protocol between the first target application and the second target application;
[0080] The processing module 220 is specifically configured to determine the target communication protocol from among all first communication protocols according to the data type of the data to be transmitted.
[0081] The technical solution of this embodiment can realize communication between any nodes when the two nodes are physically connected and reachable, and the transmission of data does not need to consider the intermediate process; therefore, the method of the present invention can be used for communication between nodes of any topology.
[0082] The above parameters and steps for each module to implement corresponding functions in an inter-node communication system 200 of this embodiment can refer to the parameters and steps in the above embodiment of an inter-node communication method, and will not be repeated here.
[0083] A storage medium provided by an embodiment of the present invention includes: instructions are stored in the storage medium, and when a computer reads the instructions, the computer executes steps such as a node-to-node communication method. For details, please refer to the parameters and steps in the embodiment of a node-to-node communication method above, which will not be repeated here.
[0084] Computer storage media such as USB flash drives, mobile hard disks, etc.
[0085] An electronic device provided by an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The electronic device is characterized in that when the processor executes the computer program, the computer executes the steps of a method for communication between nodes. For details, please refer to the parameters and steps in the embodiment of a method for communication between nodes above, which will not be elaborated here.
[0086] Those skilled in the art will appreciate that the present invention may be implemented as a method, a system, a storage medium, and an electronic device.
[0087] Therefore, the present invention can be specifically implemented in the following forms, that is, it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code. Any combination of one or more computer-readable media can be used. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can 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 (a non-exhaustive list) include: 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 this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device. Although the embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and cannot be construed as limiting the present invention, and those skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for communication between nodes, characterized in that: include: S1. Determine at least one first physical channel between a sending node and a receiving node according to a logical link; S2. Determine a target communication protocol between the first target application and the second target application of the receiving node according to the data type of the data to be transmitted in the first target application of the sending node; S3. Determine a target physical channel among all first physical channels according to the target communication protocol, and send the data to be transmitted to the second target application through each sub-physical channel in the target physical channel to realize data communication between the sending node and the receiving node; In S1, each logical channel between a sending node and a receiving node is determined according to the logical link, a first physical channel is determined according to the logical channel, and each sub-physical channel is determined according to the first physical channel; At least one intermediate node is also included between the sending node and the receiving node; All sub-physical channels include: the physical channel between the sending node, each intermediate node and each two adjacent nodes in the receiving node; Each data type corresponds to a first communication protocol; before step S2, it also includes: obtaining at least one first communication protocol between the first target application and the second target application; The S2 comprises: determining the target communication protocol among all first communication protocols according to the data type of the data to be transmitted; The sending node includes: a first application layer, a first protocol layer and a first interface layer; the receiving node includes: a second application layer, a second protocol layer and a second interface layer; the sending of the to-be-transmitted data to the second target application through each sub-physical channel in the target physical channel includes: The first target application sends the data to be transmitted to the first interface layer through the first application layer and the first protocol layer in sequence; The first interface layer sends the data to be transmitted to the second interface layer through each sub-physical channel of the target physical channel in sequence; When the second interface layer successfully verifies the data to be transmitted, the second interface layer sends the data to be transmitted to the second application through the second protocol layer and the second application layer in sequence, so as to realize data communication between the sending node and the receiving node; There are multiple communication protocols between the first target application and the second target application.
2. A method for inter-node communication according to claim 1, characterized in that: Any intermediate node includes: an intermediate interface layer and an intermediate protocol layer; the first interface layer sends the data to be transmitted to the second interface layer through each sub-physical channel of the target physical channel in turn, including: The first interface layer sends the data to be transmitted to the second interface layer in sequence through the intermediate interface layer and the intermediate protocol layer of the intermediate node corresponding to each sub-physical channel of the target physical channel.
3. A node-to-node communication system, characterized in that: include: Acquisition module, processing module and operation module; The acquisition module is used to: determine at least one first physical channel between the sending node and the receiving node according to the logical link; The processing module is used to: determine the target communication protocol between the first target application and the second target application of the receiving node according to the data type of the data to be transmitted in the first target application of the sending node; The operation module is used to: determine a target physical channel among all the first physical channels according to the target communication protocol, and send the data to be transmitted to the second target application through each sub-physical channel in the target physical channel, so as to realize data communication between the sending node and the receiving node; The acquisition module is specifically used to: determine each logical channel between the sending node and the receiving node according to the logical link, determine the first physical channel according to the logical channel, and determine each sub-physical channel according to the first physical channel; At least one intermediate node is also included between the sending node and the receiving node; All sub-physical channels include: the physical channel between the sending node, each intermediate node and each two adjacent nodes in the receiving node; Each data type corresponds to a first communication protocol; before the processing module, it also includes: a pre-processing module; The preprocessing module is used to: obtain at least one first communication protocol between the first target application and the second target application; The processing module is specifically used to: determine the target communication protocol among all first communication protocols according to the data type of the data to be transmitted; The sending node includes: a first application layer, a first protocol layer and a first interface layer; the receiving node includes: a second application layer, a second protocol layer and a second interface layer; the operation module is specifically used for: The first target application sends the data to be transmitted to the first interface layer through the first application layer and the first protocol layer in sequence; The first interface layer sends the data to be transmitted to the second interface layer through each sub-physical channel of the target physical channel in sequence; When the second interface layer successfully verifies the data to be transmitted, the second interface layer sends the data to be transmitted to the second application through the second protocol layer and the second application layer in sequence, so as to realize data communication between the sending node and the receiving node; There are multiple communication protocols between the first target application and the second target application.
4. A storage medium, characterized in that: The storage medium stores instructions, and when a computer reads the instructions, the computer executes the inter-node communication method as claimed in claim 1 or 2.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the computer is caused to execute the inter-node communication method as claimed in claim 1 or 2.
