A method and system for node communication in link resolution based on a message queue
By inserting forwarding and message conversion modules into the communication model, and combining them with a message queue agent, the problems of low transmission efficiency and poor scalability in node communication are solved, and efficient and flexible inter-node communication is achieved.
Patent Information
- Application Number
- CN202510559764.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-04-30
AI Technical Summary
Existing technologies have problems in node communication such as high bandwidth requirements, high system complexity, low transmission efficiency, and poor reliability, making it difficult to achieve low latency, high throughput, and dynamic node management.
A message queue-based link resolution method is adopted. By inserting forwarding and message conversion modules into the communication model, data packets are intercepted, headers are added, and formats are converted. Combined with a publish/subscribe message queue agent, redirected transmission is performed, supporting efficient communication between nodes.
It enables lightweight, low-latency, and high-throughput inter-node communication, supports dynamic node addition or deletion, and improves the system's flexibility and scalability.
Smart Images

Figure CN120090944B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network communication simulation, and in particular to a node communication method and system in link solution based on a message queue. Background Art
[0002] In modern communication simulations and industrial control systems, nodes need to transmit a large number of solution parameters (such as path loss, latency, and bit error rate) in real time to support dynamic adjustment and optimization of communication links. However, existing technologies for transmitting these parameters have several shortcomings. Traditional point-to-point communication methods significantly increase bandwidth requirements and system complexity as the number of nodes increases, reducing transmission efficiency. Furthermore, centralized storage or fixed connections are susceptible to network fluctuations or single points of failure, leading to data loss or transmission delays and poor reliability. The bridge-based node communication systems used in traditional network simulation tools struggle to simultaneously meet the requirements of low latency, high throughput, dynamic addition and removal of nodes, and multiple communication modes. This results in low efficiency and poor scalability, limiting the system's flexibility and expansion capabilities. Summary of the Invention
[0003] In order to solve the above technical problems, the purpose of the present invention is to provide a node communication method and system in link solution based on message queue, which can improve the communication efficiency between nodes in the link node simulation model and can dynamically add or delete nodes to achieve lightweight, low-latency and high-throughput node-to-node communication.
[0004] The first technical solution adopted by the present invention is: a node communication method in link solution based on a message queue, comprising the following steps:
[0005] Based on the message link transmission model, a forwarding module is introduced to intercept the transmission data stream and obtain the downlink data packet;
[0006] Adding an information packet header to the downlink data packet and converting it through the message conversion module to obtain a data packet with a standard format;
[0007] Configure a message queue agent to redirect and transmit data packets with a standard format to achieve communication between nodes in link solution.
[0008] Furthermore, the step of introducing a forwarding module to intercept and process the transmitted data based on the message link transmission model to obtain the downlink data packet specifically includes:
[0009] Constructing a message link transmission model, wherein the message link transmission model includes a virtual transmission layer, a MAC layer, and a physical layer;
[0010] Inserting the forwarding module below the physical layer of the message link transmission model;
[0011] The transmission data stream is intercepted and processed through the forwarding module to obtain the downlink data packet.
[0012] Furthermore, the forwarding module specifically includes a first branch thread and a second branch thread, the first branch thread is used to intercept data packets transmitted to the physical layer of the message link transmission model, and the second branch thread is used to receive network data packets through a UDP socket.
[0013] Furthermore, the step of adding an information packet header to the downlink data packet and converting it through the message conversion module to obtain a data packet with a standard format specifically includes:
[0014] Adding an information packet header to the downlink data packet and sending it to the external receiving module in a direction to obtain a data packet with the information packet header;
[0015] Load an external XML configuration file and obtain configuration parameters, including local IP, port, message queue address and topic;
[0016] Based on the forwarding module, a message conversion module is inserted to parse and convert the data packet with the information packet header in combination with the configuration parameters to obtain a data packet with a standard format.
[0017] Furthermore, the message conversion module specifically includes a first forwarding thread and a second forwarding thread, wherein:
[0018] The first forwarding thread is a UDP to ZMQ parsing and forwarding thread, which receives data packets from a specified local IP and port through a UDP socket, encapsulates the content of the received data packets into ZMQ messages, and adds subject information to identify the type and source of the message. The encapsulated data packets are sent to the message queue through the ZMQ publisher socket;
[0019] The second forwarding thread is a ZMQ to UDP parsing and forwarding thread, which receives messages from the message queue through the ZMQ subscriber socket. The received ZMQ message is parsed into a format suitable for sending through the UDP protocol, and the parsed data packet is sent to the specified target address and port through the UDP socket.
[0020] Furthermore, the step of configuring a message queue agent to redirect and transmit data packets in a standard format to achieve communication between nodes in link resolution specifically includes:
[0021] Configure a message queue agent based on the publish / subscribe model and create front-end and back-end sockets;
[0022] Binding the front-end socket to a preset address and a first port for receiving data packets having a standard format;
[0023] Bind the backend socket to the second port and forward the data packet with standard format to the subscriber to realize the communication of the nodes in the link solution.
[0024] The second technical solution adopted by the present invention is: a node communication system for link solution based on a message queue, comprising:
[0025] The first module is used to introduce a forwarding module to intercept the transmission data stream based on the message link transmission model to obtain the downlink data packet;
[0026] The second module is used to add an information packet header to the downlink data packet and convert it through the message conversion module to obtain a data packet with a standard format;
[0027] The third module is used to configure the message queue agent to redirect the transmission of data packets with a standard format to achieve communication between nodes in link resolution.
[0028] The beneficial effects of the method and system of the present invention are as follows: the present invention introduces a forwarding module based on a message link transmission model to intercept and process the transmission data stream, obtains a downlink data packet, further adds an information packet header to the downlink data packet and converts it through a message conversion module to obtain a data packet with a standard format, and by inserting a message forwarding and conversion module into a link node simulation model, changes the data transmission between nodes from a bridge mode to a publish / subscribe mode based on a message queue, thereby achieving efficient communication between nodes, and finally configures a message queue agent to redirect the transmission of data packets with a standard format to achieve communication between nodes in link solution, and by redirecting data packets and introducing message queues, has multiple communication modes, can dynamically add or delete nodes, has the characteristics of lightweight, low latency, high throughput, etc., solves the problems of low communication efficiency and insufficient scalability of conventional link solution systems, and effectively improves the flexibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a flowchart of the steps of a node communication method in link solution based on a message queue of the present invention;
[0030] Figure 2 It is a structural block diagram of a node communication system in link solution based on a message queue of the present invention;
[0031] Figure 3 It is a communication flow diagram of a node communication method based on a message queue provided by a specific embodiment of the present invention in a network simulation model embodiment system;
[0032] Figure 4It is a schematic diagram of a node communication network architecture applicable to message queues based on a specific embodiment of the present invention. DETAILED DESCRIPTION
[0033] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The step numbers in the following embodiments are provided for ease of description only and do not limit the order of the steps. The order of execution of the steps in the embodiments can be adaptively adjusted based on the understanding of those skilled in the art.
[0034] Reference Figure 1 The present invention provides a node communication method in link solution based on a message queue, the method comprising the following steps:
[0035] S100, based on the message link transmission model, introduce a forwarding module to intercept the transmission data stream and obtain the downlink data packet;
[0036] Specifically, a message link transmission model is constructed, which includes a virtual transmission layer, a MAC layer and a physical layer; a forwarding module is inserted below the physical layer of the message link transmission model; and the transmission data stream is intercepted and processed by the forwarding module to obtain downlink data packets.
[0037] Among them, the forwarding module specifically includes a first branch thread and a second branch thread. The first branch thread is used to intercept data packets transmitted to the physical layer of the message link transmission model, and the second branch thread is used to receive network data packets through a UDP socket.
[0038] In this embodiment, the forwarding module is parameterized before system startup. The node simulation model consists of three layers: the virtual transport layer, the MAC layer, and the physical layer. Downlink data flows sequentially through the virtual transport layer, the MAC layer, and the physical layer. The forwarding module is a user-defined layer inserted below the physical layer to intercept data flows.
[0039] It's also worth noting that the forwarding module in the user-defined layer is inserted below the model's physical layer and consists of two independently running threads: ProcessDownStreamMsg (the first branch thread) and ProcessUpStreamMsg (the second branch thread). The ProcessDownStreamMsg thread is responsible for intercepting downlink packets transmitted from the upper layer to the physical layer, while the ProcessUpStreamMsg thread is responsible for receiving uplink packets from the network and passing them to the upper-layer processing module.
[0040] Furthermore, after the ProcessDownStreamMsg thread is started, it initializes relevant variables (such as senderIPaddr and collectorIPaddr) from an external XML configuration file and enters an infinite loop to process packets. The thread intercepts and stores packets using thread-safe queue mechanisms (such as std::mutex and std::condition_variable). When packets are passed from the upper layer to the physical layer, the forwarding module copies them and temporarily stores them in the queue. After the thread removes the packet from the queue, it processes it according to the configured protocol type.
[0041] The ProcessUpStreamMsg thread is responsible for receiving uplink data packets from the network and passing them to the upper-layer processing module. The thread receives data packets through the UDP socket and passes them to the handleNetworkMessage function for processing.
[0042] In summary, the insertion of the forwarding module enables efficient interception and storage of downlink data packets, as well as real-time reception and processing of uplink data packets.
[0043] S200, adding an information packet header to the downlink data packet and converting it through a message conversion module to obtain a data packet with a standard format;
[0044] Specifically, an information packet header is added to the downlink data packet and sent to the external receiving module in a directed manner to obtain a data packet with an information packet header; an external XML configuration file is loaded to obtain configuration parameters, which include local IP, port, message queue address and topic; based on the forwarding module, a message conversion module is inserted to parse and convert the data packet with the information packet header in combination with the configuration parameters to obtain a data packet with a standard format.
[0045] Among them, Figure 3 As shown, the message conversion module specifically includes a first forwarding thread and a second forwarding thread. The first forwarding thread is a UDP to ZMQ parsing and forwarding thread, which receives data packets from a specified local IP and port through a UDP socket, encapsulates the content of the received data packet into a ZMQ message, and adds subject information to identify the type and source of the message. The encapsulated data packet is sent to the message queue through the ZMQ publisher socket; the second forwarding thread is a ZMQ to UDP parsing and forwarding thread, which receives messages from the message queue through a ZMQ subscriber socket. The received ZMQ message is parsed into a format suitable for sending through the UDP protocol, and the parsed data packet is sent to the specified target address and port through the UDP socket.
[0046] In this embodiment, after the forwarding module removes a data packet from the queue, it first obtains the packet's information (such as the source and destination addresses) and then adds a custom message header (such as MsgViewerHDR). The message header, which contains information such as the type, source, and destination addresses, identifies the packet's attributes and transmission path, facilitating message parsing and filtering within the publish / subscribe message queue agent. After adding the message header, the thread sends the packet to the designated external receiving module via a UDP socket, ensuring real-time data transmission.
[0047] In some specific embodiments, an external XML configuration file is first loaded to obtain parameters such as local IP, port, message queue address, topic, etc.
[0048] The UDP to ZMQ parsing and forwarding thread is started. This thread receives data packets from the specified local IP address and port via a UDP socket. Received data packets are stored in a buffer, and the sender's address and port information are recorded. This thread encapsulates the data packet contents into a ZMQ message, adding topic information to identify the message type or source. The encapsulated message is sent to the message queue via the ZMQ publisher socket. The message is sent in two parts: the first part is the topic information, and the second part is the actual data content. Message queue subscribers can select specific message types based on the topic.
[0049] The ZMQ-to-UDP parsing and forwarding thread is started. This thread receives messages from the message queue via a ZMQ subscriber socket. The subscriber socket is configured to receive only messages from a specified topic, ensuring targeted message filtering. Received ZMQ messages are parsed into UDP packets. This thread extracts the data content from the message and converts it into a format suitable for sending via the UDP protocol. The parsed packets are sent via the UDP socket to the specified destination address and port. The destination address and port information are configured during module initialization to ensure that the packets are correctly delivered to the external receiving module.
[0050] In summary, by inserting the message conversion module, efficient parsing and conversion between network data packets and message queues can be achieved, and it has high scalability.
[0051] S300: Configure a message queue agent to redirect and transmit data packets in a standard format to achieve communication between nodes in link resolution.
[0052] Specifically, a message queue agent based on the publish / subscribe mode is configured to create a front-end socket and a back-end socket; the front-end socket is bound to a preset address and a first port to receive data packets in a standard format; the back-end socket is bound to a second port to forward data packets in a standard format to subscribers, thereby realizing communication between nodes in link resolution.
[0053] In this example, a publish / subscribe message queue proxy is configured, and front-end (XSUB) and back-end (XPUB) sockets are created. The front-end socket is bound to a specified address and port (e.g., 10.99.0.100:5559) to receive messages from publishers; the back-end socket is bound to another port (e.g., 10.99.0.100:5560) to forward messages to subscribers. Figure 4 As shown, the dynamic joining and exit of nodes in the system is realized, while ensuring efficient distribution and reliable transmission of messages.
[0054] In summary, the embodiments of the present invention intercept downlink data packets by inserting a forwarding module at the physical layer; adding an information header to the data packets and sending them in a targeted manner to an external receiving module; inserting a message conversion module to convert data packets from the forwarding module into a format usable by a message queue; and configuring a message queue agent to use the message queue to transmit the redirected information. The method of the embodiments of the present invention is applicable to link resolution systems. By redirecting data packets and introducing message queues, it addresses the low communication efficiency and insufficient scalability of conventional link resolution systems. It also supports the dynamic joining and exiting of nodes, enhancing system flexibility.
[0055] Reference Figure 2 , a node communication system for link solution based on message queue, comprising:
[0056] The first module 201 is used to introduce a forwarding module to intercept the transmission data stream based on the message link transmission model to obtain a downlink data packet;
[0057] The second module 202 is used to add an information packet header to the downlink data packet and convert it through the message conversion module to obtain a data packet with a standard format;
[0058] The third module 203 is used to configure a message queue agent to redirect the transmission of data packets with a standard format to achieve communication between nodes in link resolution.
[0059] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0060] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A node communication method in link solution based on message queue, characterized in that: The following steps are involved: Constructing a message link transmission model, wherein the message link transmission model includes a virtual transmission layer, a MAC layer, and a physical layer; Inserting the forwarding module below the physical layer of the message link transmission model; The forwarding module specifically includes a first branch thread and a second branch thread, the first branch thread is used to intercept data packets transmitted to the physical layer of the message link transmission model, and the second branch thread is used to receive network data packets through a UDP socket; The transmission data stream is intercepted and processed by the forwarding module to obtain the downlink data packet; Adding an information packet header to the downlink data packet and sending it to the external receiving module in a direction to obtain a data packet with the information packet header; Load an external XML configuration file and obtain configuration parameters, including local IP, port, message queue address and topic; Based on the forwarding module, a message conversion module is inserted to parse and convert the data packet with the information packet header in combination with the configuration parameters to obtain a data packet with a standard format; Wherein, the message conversion module specifically includes a first forwarding thread and a second forwarding thread; The first forwarding thread is a UDP to ZMQ parsing and forwarding thread, which receives data packets from a specified local IP and port through a UDP socket, encapsulates the content of the received data packets into ZMQ messages, and adds subject information to identify the type and source of the message. The encapsulated data packets are sent to the message queue through the ZMQ publisher socket; The second forwarding thread is a ZMQ to UDP parsing and forwarding thread, which receives messages from the message queue through the ZMQ subscriber socket, parses the received ZMQ message into a format suitable for sending through the UDP protocol, and sends the parsed data packet to the specified target address and port through the UDP socket; Configure a message queue agent to redirect and transmit data packets with a standard format to achieve communication between nodes in link solution.
2. The node communication method in link solution based on message queue according to claim 1, characterized in that: The step of configuring a message queue agent to redirect and transmit data packets in a standard format to achieve communication between nodes in link resolution specifically includes: Configure a message queue agent based on the publish / subscribe model and create front-end and back-end sockets; Binding the front-end socket to a preset address and a first port for receiving data packets having a standard format; Bind the backend socket to the second port and forward the data packet with standard format to the subscriber to realize the communication of the nodes in the link solution.
3. A node communication system for link resolution based on a message queue, characterized in that: Includes the following modules: The first module is used to build a message link transmission model, which includes a virtual transmission layer, a MAC layer and a physical layer; Inserting the forwarding module below the physical layer of the message link transmission model; The forwarding module specifically includes a first branch thread and a second branch thread, the first branch thread is used to intercept data packets transmitted to the physical layer of the message link transmission model, and the second branch thread is used to receive network data packets through a UDP socket; The transmission data stream is intercepted and processed by the forwarding module to obtain the downlink data packet; The second module is used to add an information packet header to the downlink data packet and send it to the external receiving module in a directional manner to obtain a data packet with an information packet header; Load an external XML configuration file and obtain configuration parameters, including local IP, port, message queue address and topic; Based on the forwarding module, a message conversion module is inserted to parse and convert the data packet with the information packet header in combination with the configuration parameters to obtain a data packet with a standard format; Wherein, the message conversion module specifically includes a first forwarding thread and a second forwarding thread; The first forwarding thread is a UDP to ZMQ parsing and forwarding thread, which receives data packets from a specified local IP and port through a UDP socket, encapsulates the content of the received data packets into ZMQ messages, and adds subject information to identify the type and source of the message. The encapsulated data packets are sent to the message queue through the ZMQ publisher socket; The second forwarding thread is a ZMQ to UDP parsing and forwarding thread, which receives messages from the message queue through the ZMQ subscriber socket, parses the received ZMQ message into a format suitable for sending through the UDP protocol, and sends the parsed data packet to the specified target address and port through the UDP socket; The third module is used to configure the message queue agent to redirect the transmission of data packets with a standard format to achieve communication between nodes in link resolution.
Citation Information
Patent Citations
Carrier rocket test launch control system
CN113377091A