CN107786464B - Method and device for realizing communication between nodes - Google Patents

Method and device for realizing communication between nodes Download PDF

Info

Publication number
CN107786464B
CN107786464B CN201710862582.8A CN201710862582A CN107786464B CN 107786464 B CN107786464 B CN 107786464B CN 201710862582 A CN201710862582 A CN 201710862582A CN 107786464 B CN107786464 B CN 107786464B
Authority
CN
China
Prior art keywords
link
message
layer
queue
communication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710862582.8A
Other languages
Chinese (zh)
Other versions
CN107786464A (en
Inventor
刘应江
杨红霞
刘昊
彭正非
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Changjiang Computing Technology Co ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN201710862582.8A priority Critical patent/CN107786464B/en
Publication of CN107786464A publication Critical patent/CN107786464A/en
Application granted granted Critical
Publication of CN107786464B publication Critical patent/CN107786464B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/52Queue scheduling by attributing bandwidth to queues
    • H04L47/527Quantum based scheduling, e.g. credit or deficit based scheduling or token bank
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9057Arrangements for supporting packet reassembly or resequencing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/322Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
    • H04L69/324Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the data link layer [OSI layer 2], e.g. HDLC

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a device for realizing communication between nodes, and relates to the technical field of communication networks. The method comprises the following steps: the communication nodes are organized according to logical hierarchies, so that the logical hierarchy of the communication nodes comprises a management layer, a link layer and a bearing layer, and queues are adopted for associative cache among the management layer, the link layer and the bearing layer; then establishing a communication link between the local terminal and the opposite terminal; then, the local management layer puts the message to be sent into a sending buffer queue of a specified link, and the link layer puts the message to be sent into a confirmation queue and sends the message to an opposite communication node through a bearing layer; the opposite end puts the received message into a receiving buffer queue through a bearing layer, the link layer puts the received message into an uplink queue of the link, and the management layer acquires the received message data from the uplink queue, so that the communication between the nodes is realized. By the method, the communication efficiency of the inter-node communication can be effectively improved when the inter-node communication is realized.

Description

Method and device for realizing communication between nodes
Technical Field
The present invention relates to the technical field of communication networks, and in particular, to a method and an apparatus for implementing communication between nodes.
Background
In existing communication networks, each communication device is referred to as a node; alternatively, the communication device itself is provided with data processing functions by a plurality of service disks, each of which is also referred to as a node.
Currently, when communication between nodes is realized, data is generally copied into a socket cache and then read by an application program. However, the socket caching operation of the implementation method is complicated, and the communication efficiency is reduced; in addition, the problems of lock introduction processing, interrupt processing and the like exist, so that the complexity of the system is increased, the efficiency of a network part is influenced, and the communication efficiency of the whole system is reduced.
Therefore, how to effectively improve the communication efficiency when implementing the inter-node communication is a problem to be urgently solved by those skilled in the art.
Disclosure of Invention
The present invention is to overcome the above drawbacks of the background art, and provides a method and an apparatus for implementing inter-node communication, which can effectively improve the communication efficiency of inter-node communication when implementing inter-node communication.
In order to achieve the above object, the present invention provides a method for implementing communication between nodes, the method comprising the steps of:
step S1, organizing the communication nodes according to logic hierarchy, making the logic hierarchy of the communication nodes comprise a management layer, a link layer and a bearing layer; wherein:
the management layer is used for providing an operation interface for a specified link for a user, and comprises a link creation interface and a data transceiving interface; the link layer is used for establishing a link and transmitting and receiving user data to the management layer and transmitting and receiving messages to the bearing layer; the bearing layer is borne on the logic channel, receives and sends messages by relying on the borne logic channel, reports the received messages to the link layer and provides the messages for sending to the link layer, and one bearing layer is responsible for sending and receiving the messages of a plurality of link layers;
moreover, a transmission buffer queue is adopted between a management layer as a home terminal and a link layer for association, and a confirmation queue is adopted between the link layer and a bearing layer for association; a receiving buffer queue is adopted between a bearing layer as an opposite end and a link layer for correlation, and an uplink queue is adopted between the link layer and a management layer for correlation;
step S2, establishing a link for communication between the local end communication node and the opposite end communication node by using the link layer through the link establishing interface provided by the management layer;
step S3, sending message to opposite communication node through the data sending interface provided by the management layer of local communication node; when sending messages, the management layer puts the messages to be sent into a sending buffer queue of a specified link and informs the link layer, and the link layer adopts a segmented sending mode, puts the messages to be sent into a confirmation queue and sends the messages to an opposite-end communication node through a bearing layer;
step S4, receiving the message through a data receiving interface provided by a management layer of the opposite-end communication node; when receiving the message, the received message is put into a receiving buffer queue of the link and notified to the link layer through the bearing layer, the received message is put into an uplink queue of the link by the link layer, and the management layer acquires the received message data from the uplink queue.
On the basis of the above technical solution, in step S2, establishing a link for performing communication between the local-end communication node and the opposite-end communication node by using a link layer specifically includes the following steps:
step S201, the local terminal communication node sends a link establishment message to the opposite terminal communication node by using a link layer;
step S202, after receiving the link establishment message, the opposite end communication node sends a link establishment response message and starts a link heartbeat mechanism;
step S203, after receiving the link establishment response message, the home terminal communication node stops sending the link establishment request message, sets the link state as the link establishment state, and starts a link heartbeat mechanism to complete the establishment of the communication link.
On the basis of the technical scheme, the link layer fills data of a message to be sent into payloads of a plurality of link message fragments, encapsulates the plurality of link message fragments into a carrying message and puts the carrying message into a validation queue.
On the basis of the above technical solution, in step S3, the link layer uses a segmented transmission method to put a message to be sent into a confirmation queue and send the message to the opposite-end communication node through the bearer layer, which specifically includes the following steps:
step S301, link layer checks to confirm whether there is space in the queue for storing message to be sent, if yes, the message to be sent is obtained from the sending buffer queue, and step S302 is switched to; otherwise, re-executing S301;
step S302, judging whether a bearing message is to be sent or not at present, and if so, turning to step S303; otherwise, go to step S305;
step S303, checking whether the payload length of the current bearer message to be sent exceeds the length of a preset bearer message, if not, turning to step S306, and if so, turning to step S304;
step S304, putting the current bearer message to be sent into a confirmation queue, clearing the bearer message to be sent, and turning to step S305;
step S305, creating a new bearer message to be sent, and then turning to step S302;
step S306, distributing a link message fragment from the current bearer message to be sent, filling the obtained data of the message to be sent into the link message fragment, and turning to step S307;
step S307, determining whether the number of unproven queues in the validation queue exceeds a specified preset value, where the number of unproven queues is the dequeue number-validated number of the validation queue, the dequeue number of the validation queue is the total number of the sent bearer packets, and the validated number is the number of the bearer packets that have received a response; if yes, returning to the step S302, and if not, turning to the step S308;
step S308, acquiring a bearer message from the confirmation queue, judging whether the opposite-end communication node is congested, if not, sending the bearer message to the opposite-end communication node through a sending interface provided by a bearer layer, and increasing the dequeue number of the confirmation queue; if so, the process returns to step S307.
On the basis of the above technical solution, in step S4, the bearer layer puts the received packet into a receive buffer queue of the link and notifies the link layer, and the link layer puts the received packet into an uplink queue of the link, which specifically includes the following steps:
step S401, the bearing layer checks whether the received bearing message is legal or not, and if not, the packet is lost; if the received message is legal, the bearing message is put into a receiving buffer queue of the link and a link layer is informed;
step S402, the link layer checks whether the receiving of the bearing message in the receiving buffer queue is finished, if not, the step S403 is switched to; if the reception is finished, go to step S411;
step S403, acquiring a bearer message from the receiving buffer queue, and turning to step S404;
step S404, checking whether the type of the obtained bearing message is a data message type, if so, turning to step S405; otherwise, go to step S410;
s405, checking whether the sequence number of the bearing message is consistent with the packet receiving sequence of the link layer, and if so, turning to S406; otherwise, returning to step S402;
step S406, judging whether all link message fragments contained in the bearer message are completely recombined, if so, returning to the step S402; otherwise, go to step S407;
step S407, acquiring a link message fragment of the bearer message, and turning to step S408;
step S408, judging whether the serial number of the link message fragment is consistent with the serial number of the last bearing message, if not, establishing a new link message to be received, and then turning to step S409; if yes, directly switching to the step S409;
step S409, reassembling the link message fragments with the same sequence number into a link message to be received, putting the link message to be received into an uplink queue of a link, emptying the link message to be received, and turning to step S406;
step S410, sending a data response message to the home terminal communication node, processing a bearing message of a non-data message type, and returning to the step S402;
and step S411, sending a data response message to the local terminal communication node.
On the basis of the technical scheme, the operation interface provided by the management layer for the user further comprises a class Select operation interface and a link state and statistical query operation interface.
On the basis of the technical scheme, the link layer also provides a heartbeat mechanism for detecting the link state and supports the functions of congestion control, flow control and maximum buffer control.
On the basis of the above technical solution, the bearer layer is further configured to read information of a logical channel in a configuration file, where the content of the configuration file includes a logical channel type and communication port information.
On the basis of the above technical solution, the bearer layer may be borne on a plurality of logical channels, where the plurality of logical channels include UDP, MAC physical layer, and I2C bus.
The invention also provides a device for realizing the communication between the nodes based on the method, which is arranged in each communication node and comprises a logic layered structure establishing module, a communication link establishing module, a message sending processing module and a message receiving processing module;
the logical hierarchy creation module is to: organizing the communication nodes according to logic hierarchy, so that the logic hierarchy of the communication nodes comprises a management layer, a link layer and a bearing layer;
the communication link establishment module is to: establishing a link for communication between a local-end communication node and an opposite-end communication node by using a link layer through a link establishing interface provided by a management layer;
the message sending and processing module is used for: when the local terminal is used as the local terminal, the message is sent to the opposite-end communication node through a data sending interface provided by the management layer; when sending messages, the management layer puts the messages to be sent into a sending buffer queue of a specified link and informs the link layer, and the link layer adopts a segmented sending mode, puts the messages to be sent into a confirmation queue and sends the messages to an opposite-end communication node through a bearing layer;
the message receiving and processing module is used for: when the terminal is used as an opposite terminal, receiving the message through a data receiving interface provided by the management layer; when receiving the message, the received message is put into a receiving buffer queue of the link and notified to the link layer through the bearing layer, the received message is put into an uplink queue of the link by the link layer, and the management layer acquires the received message data from the uplink queue. The invention has the beneficial effects that:
(1) in the invention, the logical layered structure of the communication node is designed into a management layer, a link layer and a bearing layer. The management layer is used for providing an operation interface of a designated link for a user, and comprises a link creation interface and a data receiving and transmitting interface; the link layer is used for establishing a link and transmitting and receiving user data to the management layer and transmitting and receiving messages to the bearing layer; the bearing layer is borne on the logic channel, receives and sends messages by relying on the borne logic channel, reports the received messages to the link layer and provides the messages for sending to the link layer, and one bearing layer is responsible for sending and receiving the messages of a plurality of link layers; and the management layer, the link layer and the bearing layer are all designed to adopt queues for associated caching, so that the communication efficiency is improved, the problems of lock processing, interrupt processing and the like can be avoided, the system complexity is low, and the communication efficiency of the whole system is high.
(2) In the invention, a link layer fills data of a message to be sent into payloads of a plurality of link message fragments, encapsulates the plurality of link message fragments into a bearing message and puts the bearing message into a confirmation queue; and the sending end node sends the message in a segmented manner, and the receiving end receives the message in a recombined manner, so that the throughput of the bearing layer can be effectively improved.
(3) In the invention, in order to meet the function expansion requirement of communication between nodes and enable the functions of each communication node to be more powerful, the management layer provides an operation interface of a designated link for a user and also comprises a class Select operation interface and a query operation interface of link state and statistics; the link layer also provides a heartbeat mechanism for detecting the link state and supports congestion control, flow control, maximum cache control and the like; the bearer layer is also used for reading information of the logical channels in the configuration file, and the like.
(4) In the invention, the bearing layer can be borne on various logic channels, including UDP, MAC physical layer, I2C bus, etc., and the application scene is wide.
(5) In the invention, one bearing layer can be responsible for the sending and receiving of a plurality of link layer data, so a plurality of link layer processing tasks can be set for processing the receiving and sending messages, thereby further improving the communication efficiency.
Drawings
FIG. 1 is a flow chart of a method for implementing inter-node communication in an embodiment of the present invention;
FIG. 2 is a schematic block diagram of a logical hierarchy of communication nodes in an embodiment of the present invention;
FIG. 3 is a detailed flowchart of establishing a communication link according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a package structure of a bearer packet according to an embodiment of the present invention;
fig. 5 is a specific flowchart of sending a packet to an opposite-end communication node by a link layer in the embodiment of the present invention;
fig. 6 is a specific flowchart of the embodiment of the present invention in which the bearer layer places a packet into the receive buffer queue and the link layer places a packet into the uplink queue;
fig. 7 is a block diagram of an apparatus for implementing inter-node communication according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the figures and the embodiments.
Referring to fig. 1, an embodiment of the present invention provides a method for implementing inter-node communication, where the method includes the following steps:
step S1, creating a logical hierarchical structure: as shown in fig. 2, the communication nodes are organized according to logical hierarchies, so that the logical hierarchy of the communication nodes includes a management layer, a link layer and a bearer layer; wherein:
the management layer is used for providing an operation interface for a specified link for a user, and comprises a link creation interface and a data transceiving interface; the link layer is used for establishing a link and transmitting and receiving user data to the management layer and transmitting and receiving messages to the bearing layer; the bearing layer can be borne on various logic channels, receives and transmits messages by relying on the borne logic channels, reports the received messages to the link layer and provides the messages for the link layer to be sent, and one bearing layer is responsible for sending and receiving data of a plurality of link layers;
moreover, a transmission buffer queue is adopted between a management layer as a home terminal (a transmitting terminal) and a link layer for association, and a confirmation queue is adopted between the link layer and a bearing layer for association; the bearing layer as the opposite end (receiving end) is associated with the link layer by adopting a receiving buffer queue, and the link layer is associated with the management layer by adopting an uplink queue.
Furthermore, in order to meet the function expansion requirement of communication between nodes, the functions of each communication node are more powerful. In this embodiment, the operation interface for providing the specified link to the user by the management layer further includes a class Select operation interface and a query operation interface for link state and statistics. The link layer also provides a heartbeat mechanism for detecting link states and supports congestion control, flow control, maximum buffer control, etc. The bearer layer is further configured to read information of the logical channel in the configuration file, create the bearer layer, and receive the packet, where the content of the configuration file includes information of the type of the logical channel and the communication port. Moreover, the bearer layer may be carried on a plurality of logical channels, which include a UDP (User data Protocol), a MAC (Media Access Control) physical layer, an I2C (Inter-Integrated Circuit) bus, and the like, and the application scenarios are wide.
Step S2, establishing a communication link between the local terminal and the opposite terminal: and establishing a link for the communication between the local end communication node and the opposite end communication node by using the link layer through a link establishing interface provided by the management layer.
Specifically, as shown in fig. 3, the establishing a link between the local-end communication node and the opposite-end communication node by using the link layer in step S2 specifically includes the following steps:
step S201, the local terminal communication node sends a link establishment message to the opposite terminal communication node by using a link layer;
step S202, after receiving the link establishment message, the opposite end communication node sends a link establishment response message and starts a link heartbeat mechanism;
step S203, after receiving the link establishment response message, the home terminal communication node stops sending the link establishment request message, sets the link state as the link establishment state, and starts a link heartbeat mechanism, thereby completing establishment of the communication link.
Step S3, the home terminal communication node sends a message: as shown in fig. 2, a user sends a message to an opposite-end communication node through a data sending interface provided by a management layer of the local-end communication node; when the local-end communication node sends a message, the management layer puts the message to be sent into a sending buffer queue of a specified link and informs the link layer, and the link layer adopts a segmented sending mode, puts the message to be sent into a confirmation queue and sends the message to the opposite-end communication node through a sending interface provided by the bearing layer.
It can be understood that, in order to enhance the throughput of the bearer layer and further improve the communication efficiency, in this embodiment, the link layer fills the data of the message to be sent into the payloads of the multiple link message fragments, and encapsulates the multiple link message fragments into one bearer message, and puts the bearer message into the validation queue. Specifically, the format structure of the multiple link packets encapsulated into the bearer packet is shown in fig. 4, where a bearer packet header records a local end link identifier, an opposite end link identifier, a sending sequence, a link packet frame number, payload length information, and the like; the link message header records information such as the serial number, the current frame length and the like of the bearer message, and link message fragments with the same serial number are reassembled at a receiving end. On this basis, as shown in fig. 5, in step S3, the link layer uses a segmented transmission method to put the message to be sent into the confirmation queue and send the message to the opposite-end communication node through the transmission interface provided by the bearer layer, which specifically includes the following steps:
step S301, link layer checks to confirm whether there is space in the queue for storing message to be sent, if yes, the message to be sent is obtained from the sending buffer queue, and step S302 is switched to; otherwise, re-executing S301;
step S302, judging whether the bearing message is to be sent currently (whether the bearing message is to be sent by checking the link layer object or not), if so, turning to step S303; otherwise, go to step S305;
step S303, checking whether the payload length of the current bearer message to be sent exceeds the length of a preset bearer message, if not, turning to step S306, and if so, turning to step S304;
step S304, putting the current bearer message to be sent into a confirmation queue, clearing the bearer message to be sent, and turning to step S305;
step S305, creating a new bearer message to be sent, and then turning to step S302;
step S306, distributing a link message fragment from the current bearer message to be sent, filling the obtained data of the message to be sent into the link message fragment, and turning to step S307;
step S307, determining whether the number of unproven numbers in the validation queue exceeds a specified preset value (the specified preset value may be set and adjusted according to specific situations), where the number of unproven numbers is the number of dequeues of the validation queue (i.e. the total number of sent bearer packets) -the validated number, and the validated number is the number of bearer packets that have received a response; if yes, returning to the step S302, and if not, turning to the step S308; it can be understood that, each time the opposite end communication node receives the bearer packet, it will send a corresponding response data packet, and after the local end communication node receives the response corresponding to the sent bearer packet, it indicates that the bearer packet is verified, and then the corresponding verified number will be incremented. Only when the number which is not confirmed in the queue does not exceed a specified preset value, the carrying message is sent, so that the purpose of effectively controlling the sending of the carrying message is achieved, and the communication effect is improved;
step S308, after obtaining the bearer message from the confirmation queue, judging whether the opposite communication node is congested, if not, sending the bearer message to the opposite communication node through a sending interface provided by a bearer layer, and increasing the dequeue number of the confirmation queue; if so, the process returns to step S307.
Step S4, the opposite end communication node receives the packet: as shown in fig. 2, the peer user receives a packet through a data receiving interface provided by a management layer of the peer communication node; when the opposite end communication node receives the message, the received message is put into a receiving buffer queue of the link and is informed to the link layer through a receiving interface provided by the bearing layer, the link layer puts the received message into an uplink queue of the link, and the management layer acquires the received message data from the uplink queue.
It can also be understood that, in this embodiment, since the packet received by the bearer layer is a bearer packet and the data of the original packet is stored in the payloads of the multiple link packet fragments, in order to obtain the data of the original packet, the link layer at the opposite end reassembles and receives the link packet fragments in the bearer packet. On this basis, as shown in fig. 6, in step S4, the bearer layer puts the received packet into the receive buffer queue of the link and notifies the link layer, and the link layer puts the received packet into the uplink queue of the link, which specifically includes the following steps:
step S401, the bearing layer checks whether the received bearing message is legal or not, and if not, the packet is lost; if the received message is legal, the bearing message is put into a receiving buffer queue of the link and a link layer is informed;
step S402, the link layer checks whether the receiving of the bearing message in the receiving buffer queue is finished, if not, the step S403 is switched to; otherwise, go to step S411;
step S403, acquiring a bearer message from the receiving buffer queue, and turning to step S404;
step S404, checking whether the type of the obtained bearing message is a data message type, if so, turning to step S405; otherwise, go to step S410;
s405, checking whether the sequence number of the bearing message is consistent with the packet receiving sequence of the link layer, and if so, turning to S406; otherwise, returning to step S402;
step S406, judging whether all link message fragments contained in the bearer message are completely recombined, if so, returning to the step S402; otherwise, go to step S407;
step S407, acquiring a link message fragment of the bearer message, and turning to step S408;
step S408, judging whether the serial number of the link message fragment is consistent with the serial number of the last bearing message, if not, establishing a new link message to be received, and then turning to step S409; if yes, directly switching to the step S409;
step S409, reassembling the link message fragments with the same sequence number into a link message to be received, putting the link message to be received into an uplink queue of a link, emptying the link message to be received, and turning to step S406;
step S410, sending a data response message to the local communication node, wherein the confirmed number in the confirmation queue of the local communication node is increased progressively; processing the bearing message of the non-data message type, and returning to the step S402;
step S411, sending a data response message to the local communication node, wherein the confirmed number in the confirmation queue of the local communication node is increased progressively.
It can be appreciated that, in order to further save communication overhead and improve communication efficiency. In actual operation, after the bearer packet is received, the link layer may encapsulate the acknowledgement information into a data response packet for batch acknowledgement, which represents that the previous bearer packet has been completely received, thereby improving the processing efficiency of the communication node at the receiving end and effectively saving communication overhead.
Referring to fig. 7, an embodiment of the present invention further provides a device for implementing inter-node communication based on the foregoing method, where the device is disposed in each communication node, and includes a logic hierarchical structure creation module, a communication link establishment module, a message sending processing module, and a message receiving processing module;
the logical hierarchy creation module is to: organizing the communication nodes according to logic hierarchy, so that the logic hierarchy of the communication nodes comprises a management layer, a link layer and a bearing layer;
the communication link establishment module is to: establishing a link for communication between a local-end communication node and an opposite-end communication node by using a link layer through a link establishing interface provided by a management layer;
the message sending and processing module is used for: when the local terminal is used as the local terminal, the message is sent to the opposite-end communication node through a data sending interface provided by the management layer; when sending messages, the management layer puts the messages to be sent into a sending buffer queue of a specified link and informs the link layer, and the link layer adopts a segmented sending mode, puts the messages to be sent into a confirmation queue and sends the messages to an opposite-end communication node through a bearing layer;
the message receiving and processing module is used for: when the terminal is used as an opposite terminal, receiving the message through a data receiving interface provided by the management layer; when receiving the message, the received message is put into a receiving buffer queue of the link and notified to the link layer through the bearing layer, the received message is put into an uplink queue of the link by the link layer, and the management layer acquires the received message data from the uplink queue.
It can be understood that the specific flow of the actual operation performed by each module in the apparatus for implementing inter-node communication corresponds to the specific operation steps in the method for implementing inter-node communication, and is not described herein again.
It should be noted that: in the above embodiment, when the device implements inter-node communication, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the system is divided into different functional modules to complete all or part of the functions described above.
The present invention is not limited to the above-described embodiments, and it will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and such modifications and improvements are also considered to be within the scope of the present invention.
Those not described in detail in this specification are within the skill of the art.

Claims (8)

1. A method for enabling inter-node communication, the method comprising the steps of:
step S1, organizing the communication nodes according to logic hierarchy, making the logic hierarchy of the communication nodes comprise a management layer, a link layer and a bearing layer; wherein:
the management layer is used for providing an operation interface for a specified link for a user, and comprises a link creation interface and a data transceiving interface; the link layer is used for establishing a link and transmitting and receiving user data to the management layer and transmitting and receiving messages to the bearing layer; the bearing layer is borne on the logic channel, receives and sends messages by relying on the borne logic channel, reports the received messages to the link layer and provides the messages for sending to the link layer, and one bearing layer is responsible for sending and receiving the messages of a plurality of link layers;
moreover, a transmission buffer queue is adopted between a management layer as a home terminal and a link layer for association, and a confirmation queue is adopted between the link layer and a bearing layer for association; a receiving buffer queue is adopted between a bearing layer as an opposite end and a link layer for correlation, and an uplink queue is adopted between the link layer and a management layer for correlation;
step S2, establishing a link for communication between the local end communication node and the opposite end communication node by using the link layer through the link establishing interface provided by the management layer;
step S3, sending message to opposite communication node through the data sending interface provided by the management layer of local communication node; when sending messages, the management layer puts the messages to be sent into a sending buffer queue of a specified link and informs the link layer, and the link layer adopts a segmented sending mode, puts the messages to be sent into a confirmation queue and sends the messages to an opposite-end communication node through a bearing layer;
step S4, receiving the message through a data receiving interface provided by a management layer of the opposite-end communication node; when receiving a message, the received message is put into a receiving buffer queue of a link and notified to a link layer through a bearing layer, the received message is put into an uplink queue of the link by the link layer, and a management layer acquires received message data from the uplink queue;
wherein, the link layer fills the data of the message to be sent into the payloads of a plurality of link message fragments, encapsulates the plurality of link message fragments into a bearing message and puts the bearing message into a confirmation queue,
in step S3, the link layer uses a segmented transmission method to put the message to be sent into the confirmation queue and send the message to the opposite communication node through the bearer layer, which specifically includes the following steps:
step S301, link layer checks to confirm whether there is space in the queue for storing message to be sent, if yes, the message to be sent is obtained from the sending buffer queue, and step S302 is switched to; otherwise, re-executing S301;
step S302, judging whether a bearing message is to be sent or not at present, and if so, turning to step S303; otherwise, go to step S305;
step S303, checking whether the payload length of the current bearer message to be sent exceeds the length of a preset bearer message, if not, turning to step S306, and if so, turning to step S304;
step S304, putting the current bearer message to be sent into a confirmation queue, clearing the bearer message to be sent, and turning to step S305;
step S305, creating a new bearer message to be sent, and then turning to step S302;
step S306, distributing a link message fragment from the current bearer message to be sent, filling the obtained data of the message to be sent into the link message fragment, and turning to step S307;
step S307, determining whether the number of unproven queues in the validation queue exceeds a specified preset value, where the number of unproven queues is the dequeue number-validated number of the validation queue, the dequeue number of the validation queue is the total number of the sent bearer packets, and the validated number is the number of the bearer packets that have received a response; if yes, returning to the step S302, and if not, turning to the step S308;
step S308, acquiring a bearer message from the confirmation queue, judging whether the opposite-end communication node is congested, if not, sending the bearer message to the opposite-end communication node through a sending interface provided by a bearer layer, and increasing the dequeue number of the confirmation queue; if so, the process returns to step S307.
2. The method of enabling inter-node communication of claim 1, wherein: in step S2, establishing a link for communicating between the local-end communication node and the opposite-end communication node by using the link layer, specifically including the following steps:
step S201, the local terminal communication node sends a link establishment message to the opposite terminal communication node by using a link layer;
step S202, after receiving the link establishment message, the opposite end communication node sends a link establishment response message and starts a link heartbeat mechanism;
step S203, after receiving the link establishment response message, the home terminal communication node stops sending the link establishment request message, sets the link state as the link establishment state, and starts a link heartbeat mechanism to complete the establishment of the communication link.
3. The method of enabling inter-node communication of claim 1, wherein: in step S4, the bearer layer puts the received packet into a receive buffer queue of the link and notifies the link layer, and the link layer puts the received packet into an uplink queue of the link, which specifically includes the following steps:
step S401, the bearing layer checks whether the received bearing message is legal or not, and if not, the packet is lost; if the received message is legal, the bearing message is put into a receiving buffer queue of the link and a link layer is informed;
step S402, the link layer checks whether the receiving of the bearing message in the receiving buffer queue is finished, if not, the step S403 is switched to; if the reception is finished, go to step S411;
step S403, acquiring a bearer message from the receiving buffer queue, and turning to step S404;
step S404, checking whether the type of the obtained bearing message is a data message type, if so, turning to step S405; otherwise, go to step S410;
s405, checking whether the sequence number of the bearing message is consistent with the packet receiving sequence of the link layer, and if so, turning to S406; otherwise, returning to step S402;
step S406, judging whether all link message fragments contained in the bearer message are completely recombined, if so, returning to the step S402; otherwise, go to step S407;
step S407, acquiring a link message fragment of the bearer message, and turning to step S408;
step S408, judging whether the serial number of the link message fragment is consistent with the serial number of the last bearing message, if not, establishing a new link message to be received, and then turning to step S409; if yes, directly switching to the step S409;
step S409, reassembling the link message fragments with the same sequence number into a link message to be received, putting the link message to be received into an uplink queue of a link, emptying the link message to be received, and turning to step S406;
step S410, sending a data response message to the home terminal communication node, processing a bearing message of a non-data message type, and returning to the step S402;
and step S411, sending a data response message to the local terminal communication node.
4. A method of enabling inter-node communication according to any of claims 1 to 3, characterized by: the operation interface provided by the management layer for the user also comprises a class Select operation interface and a query operation interface of link state and statistics.
5. A method of enabling inter-node communication according to any of claims 1 to 3, characterized by: the link layer also provides a heartbeat mechanism for detecting the link state and supports the functions of congestion control, flow control and maximum buffer control.
6. A method of enabling inter-node communication according to any of claims 1 to 3, characterized by: the bearing layer is also used for reading the information of the logic channel in the configuration file, and the content of the configuration file comprises the type of the logic channel and the information of the communication port.
7. A method of enabling inter-node communication according to any of claims 1 to 3, characterized by: the bearer layer may be carried over a variety of logical channels including UDP, MAC physical layer, I2C bus.
8. An apparatus for implementing communication between nodes based on the method of claim 1, wherein: the device is arranged in each communication node and comprises a logic layered structure establishing module, a communication link establishing module, a message sending processing module and a message receiving processing module;
the logical hierarchy creation module is to: organizing the communication nodes according to logic hierarchy, so that the logic hierarchy of the communication nodes comprises a management layer, a link layer and a bearing layer;
the communication link establishment module is to: establishing a link for communication between a local-end communication node and an opposite-end communication node by using a link layer through a link establishing interface provided by a management layer;
the message sending and processing module is used for: when the local terminal is used as the local terminal, the message is sent to the opposite-end communication node through a data sending interface provided by the management layer; when sending messages, the management layer puts the messages to be sent into a sending buffer queue of a specified link and informs the link layer, and the link layer adopts a segmented sending mode, puts the messages to be sent into a confirmation queue and sends the messages to an opposite-end communication node through a bearing layer;
the message receiving and processing module is used for: when the terminal is used as an opposite terminal, receiving the message through a data receiving interface provided by the management layer; when receiving the message, the received message is put into a receiving buffer queue of the link and notified to the link layer through the bearing layer, the received message is put into an uplink queue of the link by the link layer, and the management layer acquires the received message data from the uplink queue.
CN201710862582.8A 2017-09-22 2017-09-22 Method and device for realizing communication between nodes Active CN107786464B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710862582.8A CN107786464B (en) 2017-09-22 2017-09-22 Method and device for realizing communication between nodes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710862582.8A CN107786464B (en) 2017-09-22 2017-09-22 Method and device for realizing communication between nodes

Publications (2)

Publication Number Publication Date
CN107786464A CN107786464A (en) 2018-03-09
CN107786464B true CN107786464B (en) 2020-04-21

Family

ID=61433539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710862582.8A Active CN107786464B (en) 2017-09-22 2017-09-22 Method and device for realizing communication between nodes

Country Status (1)

Country Link
CN (1) CN107786464B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109922537B (en) * 2019-03-29 2024-03-15 广州邦讯信息系统有限公司 Wireless module and implementation method thereof
CN113438182B (en) * 2021-03-30 2023-05-19 南京大学 Credit-based flow control system and flow control method
CN113724485B (en) * 2021-09-03 2022-08-26 重庆邮电大学 Rapid intensive information acquisition method
CN114356825B (en) * 2021-12-17 2024-02-13 郑州信大捷安信息技术股份有限公司 SPI two-way communication method and system based on chip

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009865A (en) * 2007-01-30 2007-08-01 中兴通讯股份有限公司 Data processing method for the packet service transfer link of the wireless communication system of the terminal
CN101252534A (en) * 2008-03-28 2008-08-27 清华大学 Method for improving mobile self-organizing network communication capacity through link layer message combination
CN102014067A (en) * 2010-12-14 2011-04-13 北京星网锐捷网络技术有限公司 Message fragment sending method, device and network equipment
CN103036904A (en) * 2012-12-27 2013-04-10 东方通信股份有限公司 Method of data reliable transmission with user datagram protocol (UDP) in communication network
CN106850188A (en) * 2017-01-24 2017-06-13 中国航天系统科学与工程研究院 A kind of data transmission system based on multichannel isomery one-way transmission path

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10313492B2 (en) * 2015-05-29 2019-06-04 Samsung Electronics Co., Ltd. Layer one signaling for physical layer pipes (PLPS)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009865A (en) * 2007-01-30 2007-08-01 中兴通讯股份有限公司 Data processing method for the packet service transfer link of the wireless communication system of the terminal
CN101252534A (en) * 2008-03-28 2008-08-27 清华大学 Method for improving mobile self-organizing network communication capacity through link layer message combination
CN102014067A (en) * 2010-12-14 2011-04-13 北京星网锐捷网络技术有限公司 Message fragment sending method, device and network equipment
CN103036904A (en) * 2012-12-27 2013-04-10 东方通信股份有限公司 Method of data reliable transmission with user datagram protocol (UDP) in communication network
CN106850188A (en) * 2017-01-24 2017-06-13 中国航天系统科学与工程研究院 A kind of data transmission system based on multichannel isomery one-way transmission path

Also Published As

Publication number Publication date
CN107786464A (en) 2018-03-09

Similar Documents

Publication Publication Date Title
JP7079866B2 (en) Packet processing method and device
CN107786464B (en) Method and device for realizing communication between nodes
JP2021528014A (en) Information transmission method and equipment
WO2019029643A1 (en) Communication method, base station, terminal device and system
EP2445250A1 (en) Data packet sending, receiving and transmission method and device
US11968565B2 (en) User plane information reporting method and apparatus
CN110351030A (en) Message transmitting method, device and system
CN105191216A (en) System and method for buffer status reporting for multi-stream aggregation
CN110493823B (en) Data processing method and device
CN114073043A (en) Method and device for managing Ethernet bridge port
EP2153597B1 (en) Method of data processing in a wireless communication system
US10764411B2 (en) Stream control transmission protocol SCTP-based communications method and system, and apparatus
US20220255849A1 (en) Data Transmission Method and Apparatus
US20210306913A1 (en) Sidelink communications method and apparatus
JP7192140B2 (en) Policy management method and device
CN104685959B (en) Passive radio link control entity with unified interface
CN110312226A (en) Transmit the method and communication device of data
CN104754521A (en) Message transmitting method, wireless access point, wireless controller and system
CN113938431A (en) Burst data packet transmission method and device and electronic equipment
US11064503B2 (en) Method and apparatus for transmitting control information
CN102118356A (en) Message transmission method and transmission device
WO2021160158A1 (en) Transmission method and network device
CN114846774B (en) Communication method and device
WO2023065965A1 (en) Communication method and apparatus, and storage medium
US10834784B2 (en) Data transmission process of heterogeneous LWA network and associated base station for mobile communication

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200819

Address after: 430000 part of the third floor of cable building, Guandong science and Technology Park, Donghu New Technology Development Zone, Wuhan, Hubei Province

Patentee after: Wuhan Changjiang Computing Technology Co.,Ltd.

Address before: 430000 East Lake high tech Development Zone, Hubei Province, No. 6, No., high and new technology development zone, No. four

Patentee before: FIBERHOME TELECOMMUNICATION TECHNOLOGIES Co.,Ltd.

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method and device for realizing communication between nodes

Effective date of registration: 20210531

Granted publication date: 20200421

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: Wuhan Changjiang Computing Technology Co.,Ltd.

Registration number: Y2021420000031

PC01 Cancellation of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20230914

Granted publication date: 20200421

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: Wuhan Changjiang Computing Technology Co.,Ltd.

Registration number: Y2021420000031