A method for implementing a point-to-multipoint ad hoc network protocol stack

Through the use of point-to-multipoint ad hoc network protocol stack, heartbeat message maintenance connection, dynamic scheduling channel, and data sharding and reorganization, the problem of topological changes and transmission delay increases caused by dynamic movement of nodes in ad hoc network is solved. , improves the flexibility and stability of data transmission.

CN118900219BActive Publication Date: 2024-12-27JIANGSU AOKANG YINHUA TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411399621.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2024-12-27
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

Dynamic movement of nodes in the ad hoc network leads to frequent changes in network topology and complex routing; the lack of fixed infrastructure leads to an increase in transmission delay; the maximum transmission unit for data transmission is limited, and changes in the network environment affect stability.

Method used

The point-to-multipoint ad hoc network protocol stack is adopted to maintain connections through heartbeat messages, dynamically schedule data transmission channels, support data sharding and reorganization, and realize flexible network communication.

Benefits of technology

Effectively adapt to network topology changes, reduce transmission delay, and improve data transmission flexibility and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118900219B_ABST
    Figure CN118900219B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of ad hoc networks, and specifically discloses a method for implementing a point-to-multipoint ad hoc network protocol stack, the method comprising scheduling function modules, establishing an ad hoc network, establishing a connection, and monitoring a heartbeat message. The scheme sets a terminal slave node to send a heartbeat message to maintain the connection of the ad hoc network, and the slave node can actively join the existing network or automatically switch to other new master node networks to adapt to flexible changes in network topology; by dynamically scheduling the position and length of the uplink data transmission channel and the downlink data transmission channel, the utilization rate of the frame time slot is improved, and the delay is effectively reduced; by data segmentation and reorganization, data transmission with a larger length is supported, the flexibility of data transmission is improved, and it is effectively adapted to various network environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of ad hoc networks, and in particular to a method for realizing a point-to-multipoint ad hoc network protocol stack. Background Art

[0002] An ad hoc network is a temporary network consisting of a group of wireless nodes without fixed infrastructure support. Each node acts as a sender and receiver of data. It is highly dynamic and flexible and can quickly form a network without the need for centralized management. The nodes in a general ad hoc network are dynamically mobile, resulting in frequent changes in the network topology. The network protocol needs to constantly adapt to the new topology, resulting in complex routing problems. A general ad hoc network usually does not have a fixed infrastructure. The master node needs to act as a relay node to forward data. As the number of slave nodes increases, the transmission delay also increases. The maximum transmission unit of general data transmission is limited. The maximum transmission unit values ​​of different types of networks are different. Changes in the network environment affect the stability of data transmission. Summary of the invention

[0003] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides a point-to-multipoint ad hoc network protocol stack implementation method. In view of the fact that the nodes in a general ad hoc network are dynamically mobile, resulting in frequent changes in the network topology, the network protocol needs to constantly adapt to the new topology, resulting in complex routing selection. In this solution, a terminal slave node is set to send a heartbeat message to maintain the connection of the ad hoc network. The slave node can actively join the existing network or automatically switch to other new master node networks to adapt to the flexible changes in the network topology. In view of the fact that a general ad hoc network usually does not have a fixed infrastructure, the master node needs to act as a relay node to forward data, and as the number of slave nodes increases, the transmission delay also increases. In this solution, the position and length of the uplink data transmission channel and the downlink data transmission channel are dynamically scheduled to improve the utilization rate of the frame time slot and effectively reduce the delay. In view of the fact that the maximum transmission unit of general data transmission is limited, the maximum transmission unit values ​​of different types of networks are different, and changes in the network environment affect the stability of data transmission, this solution supports data transmission with a larger length through data fragmentation and reorganization, improves the flexibility of data transmission, and effectively adapts to various network environments.

[0004] The technical solution adopted by the present invention is as follows: a point-to-multipoint ad hoc network protocol stack provided by the present invention comprises a fixed master node and multiple slave nodes, which form a star network topology through wireless connection, wherein the data sent from the master node to the slave node is used as downlink data, and the data sent from the slave node to the master node is used as uplink data, and the slave node continuously sends heartbeat messages to maintain the connection state with the master node; the master and slave nodes perform network communication through the protocol stack, and the protocol stack is divided according to functions, including a data management module, a network management module, a data forwarding control module, and a resource scheduling module;

[0005] The data management module is responsible for the sending, receiving, encapsulating, fragmenting and reassembling of data; it includes a receiving end and a sending end, the receiving end receives the application layer data and encapsulates it into protocol stack data, and the sending end decapsulates the protocol stack data and forwards it to the application layer;

[0006] The network management module manages the connection status of the ad hoc network, monitors the heartbeat messages to maintain the neighbor association status of the master and slave nodes, and processes the connection, disconnection and reconnection of the ad hoc network;

[0007] The data forwarding control module manages the routing and forwarding strategies of data packets, including uplink data transmission, uplink control message transmission, downlink data transmission, and downlink control message transmission. Uplink data and downlink data include fragmentation and non-fragmentation.

[0008] The resource scheduling module is responsible for the dynamic allocation of uplink data transmission channels. If other slave nodes have no data transmission at the current moment, all uplink data transmission channels are allocated to the current slave node for use; if more than one slave node needs to transmit data at the current moment, a dynamic allocation method is used to allocate frame time slots to the slave nodes, and the slave nodes encapsulate the uplink data according to the allocated frame time slot length.

[0009] Furthermore, when the data length of uplink data and downlink data transmission exceeds the maximum transmission length of the physical layer, the data forwarding control module fragments the data: the downlink data is fragmented according to a fixed length, encrypted and transmitted in a broadcast manner, and each fragment is retransmitted according to the configured number of retransmissions; the uplink data sends a resource scheduling request according to the remaining length of the data, fragments, encapsulates and encrypts according to the data length allocated in the resource scheduling response message, and confirms whether retransmission is required through an ACK message. The master node decrypts the fragments after receiving them, and reassembles the data after receiving all the fragments and forwards it to the application layer.

[0010] Furthermore, in the data management module, the protocol stack data is divided into a fixed header part and a payload part: the fixed header part has a length of 10B; the payload part has a variable length and is used to carry transmission data.

[0011] Furthermore, in the resource scheduling module, the dynamic allocation method adopts the method of applying first and then using: the slave node sends an application to the master node, the master node allocates resources to the slave node according to the current resource occupancy situation, the slave node transmits uplink data according to the dynamic resources allocated by the master node, and uses the resource request queue to store the application information of the slave node; the master node uses the frame cache linked list to record the frames for which resource allocation has been completed and the resource allocation response information to be sent, and the linked list nodes represent the resource allocation data to be sent for each frame, and the specific steps are as follows:

[0012] Step A1: The master node reads the resource request queue and determines whether the queue is empty. If the queue is empty, the scheduling ends; if the queue is not empty, step A2 is executed;

[0013] Step A2: Determine whether the frame buffer linked list is empty, as follows:

[0014] Step A21: If the frame buffer linked list is empty, create a new linked list node, the linked list node ID is the global frame number, record the slave node ID, the starting time slot number is 1, the number of occupied time slots n is the length of the message transmitted by the slave node, update the number of available time slots of the frame to maxSlot-n, maxSlot represents the maximum number of time slots, and go to step A1;

[0015] Step A22: If the frame buffer linked list is not empty, read the last linked list node to obtain the frame number Fn and the number of remaining time slots m of the frame;

[0016] Step A3: Calculate whether the remaining time slots can accommodate the message header length, as follows:

[0017] Step A31: If the remaining number of time slots can accommodate the message header length, calculate whether the remaining number of time slots in the frame can accommodate the length requested by the slave node, as follows:

[0018] Step A311: If the number of remaining time slots in the frame can accommodate the length requested by the slave node, record the slave node ID, update the starting time slot number to maxSlot-n, the number of occupied time slots n is the message length, and update the number of available time slots in the frame to mn;

[0019] Step A312: If the number of remaining time slots in the frame cannot accommodate the length requested by the slave node, record the slave node ID, update the starting time slot number to maxSlot-n, and occupy the time slot number , update the number of available time slots of the frame to 0;

[0020] Step A32: If the remaining number of time slots cannot accommodate the message header length, create a new linked list node with the linked list node ID of Fn+1, record the slave node ID, the starting time slot number is 1, the number of occupied time slots is the length of the message transmitted by the slave node, update the number of available time slots of the frame to maxSlot-n, and go to step A1.

[0021] Furthermore, a method for implementing a point-to-multipoint ad hoc network protocol stack comprises the following steps:

[0022] Step S1: The protocol stack initiates a task and schedules each functional module;

[0023] Step S2: The master node establishes an ad hoc network to provide a communication connection between the master node and the slave nodes;

[0024] Step S3: The slave node starts and actively sends a heartbeat message to join the ad hoc network created by the master node. The master node authenticates the slave node. After the authentication is passed, the slave node establishes a connection with the master node and receives the broadcast message of the master node.

[0025] Step S4: The protocol stack monitors the heartbeat message and maintains the master-slave node neighbor association status; if the slave node loses connection with the master node, the protocol stack initiates a network scan request to the physical layer to match the new master node. After the match is successful, the slave node joins the new master node self-organizing network.

[0026] The beneficial effects achieved by the present invention using the above scheme are as follows:

[0027] (1) In general, nodes in self-organizing networks are dynamically moving, resulting in frequent changes in network topology. Network protocols need to constantly adapt to new topological structures, leading to complex routing selection problems. This solution sets the terminal slave node to send heartbeat messages to maintain the connection of the self-organizing network. The slave node can either actively join the existing network or automatically switch to other new master node networks to adapt to flexible changes in network topology.

[0028] (2) In view of the fact that general ad hoc networks usually do not have fixed infrastructure, the master node needs to act as a relay node to forward data. As the number of slave nodes increases, the transmission delay also increases. This scheme improves the utilization rate of frame time slots and effectively reduces the delay by dynamically scheduling the position and length of the uplink data transmission channel and the downlink data transmission channel.

[0029] (3) In view of the fact that the maximum transmission unit of general data transmission is limited, the maximum transmission unit values ​​of different types of networks are different, and changes in the network environment affect the stability of data transmission, this solution supports data transmission of longer lengths through data fragmentation and reassembly, improves the flexibility of data transmission, and effectively adapts to various network environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 An architectural diagram of a point-to-multipoint ad hoc network protocol stack proposed by the present invention;

[0031] Figure 2 It is the message format of the protocol stack data;

[0032] Figure 3 It is a flowchart of the dynamic allocation method;

[0033] Figure 4 is a schematic diagram of a frame buffer linked list in Embodiment 5;

[0034] Figure 5 This is a timing diagram of downlink data transmission in Example 7.

[0035] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION

[0036] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0037] In the description of the present invention, it should be understood that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.

[0038] Example 1, see Figure 1 The present invention provides a point-to-multipoint ad hoc network protocol stack, wherein a fixed master node and slave nodes are connected wirelessly to form a star network topology, wherein data sent from the master node to the slave node is used as downlink data, and data sent from the slave node to the master node is used as uplink data, and the slave node continuously sends heartbeat messages to maintain the connection state with the master node; the master and slave nodes communicate with each other through the protocol stack, and the protocol stack is divided according to functions, including a data management module, a network management module, a data forwarding control module, and a resource scheduling module;

[0039] The data management module is responsible for the sending, receiving, encapsulating, fragmenting and reassembling of data; it includes a receiving end and a sending end, the receiving end receives the application layer data and encapsulates it into protocol stack data, and the sending end decapsulates the protocol stack data and forwards it to the application layer;

[0040] The network management module manages the connection status of the ad hoc network, monitors the heartbeat messages to maintain the neighbor association status of the master and slave nodes, and processes the connection, disconnection and reconnection of the ad hoc network;

[0041] The data forwarding control module manages the routing and forwarding strategies of data packets, including uplink data transmission, uplink control message transmission, downlink data transmission, and downlink control message transmission. Uplink data and downlink data include fragmentation and non-fragmentation.

[0042] The resource scheduling module is responsible for the dynamic allocation of uplink data transmission channels. If other slave nodes have no data transmission at the current moment, all uplink data transmission channels are allocated to the current slave node for use; if more than one slave node needs to transmit data at the current moment, a dynamic allocation method is used to allocate frame time slots to the slave nodes, and the slave nodes encapsulate the uplink data according to the allocated frame time slot length.

[0043] Example 2, see Figure 1 and Figure 2 This embodiment is based on the above embodiment. In the data management module, the protocol stack data is divided into a fixed header part and a payload part: the fixed header part is 10B in length, of which the type occupies 3 bits, the fragment ID occupies 5 bits, the sequence number occupies 1B, the offset occupies 1B, the CRC check code occupies 2B, the total length of the data packet occupies 10 bits, the source node ID occupies 11 bits, the target node ID occupies 11 bits, and the remaining length of the data occupies 1B; the payload part is variable in length and is used to carry the transmission data.

[0044] Example 3, see Figure 1 and Figure 2 This embodiment is based on the above embodiment. When the data length of uplink data and downlink data transmission exceeds the maximum transmission length of the physical layer, the data forwarding control module fragments the data: the downlink data is fragmented according to a fixed length, encrypted and transmitted in a broadcast manner, and each fragment is retransmitted according to the configured number of retransmissions; the uplink data sends a resource scheduling request according to the remaining length of the data, fragments, encapsulates and encrypts according to the data length allocated in the resource scheduling response message, and confirms whether retransmission is required through an ACK message. The master node decrypts after receiving the fragments, and reassembles the data after receiving all the fragments and forwards it to the application layer.

[0045] By executing the operations, the maximum transmission unit of general data transmission is limited, the maximum transmission unit values ​​of different types of networks are different, and changes in the network environment affect the stability of data transmission. This solution supports data transmission with longer lengths through data fragmentation and reorganization, improves the flexibility of data transmission, and effectively adapts to various network environments.

[0046] Example 4, see Figure 1 and Figure 3This embodiment is based on the above embodiment. In the resource scheduling module, the dynamic allocation method adopts the method of applying first and then using: the slave node sends an application to the master node, the master node allocates resources to the slave node according to the current resource occupancy situation, and the slave node transmits uplink data according to the dynamic resources allocated by the master node; the master node uses the resource request queue to store the application information of the slave node, and uses the frame cache linked list to record the frames that have completed resource allocation and the resource allocation response information that needs to be issued. The linked list nodes represent the resource allocation data to be sent for each frame. The specific steps are as follows:

[0047] Step A1: The master node reads the resource request queue and determines whether the queue is empty. If the queue is empty, the scheduling ends; if the queue is not empty, step A2 is executed;

[0048] Step A2: Determine whether the frame buffer linked list is empty, as follows:

[0049] Step A21: If the frame buffer linked list is empty, create a new linked list node, the linked list node ID is the global frame number, record the slave node ID, the starting time slot number is 1, the number of occupied time slots n is the length of the message transmitted by the slave node, update the number of available time slots of the frame to maxSlot-n, maxSlot represents the maximum number of time slots, and go to step A1;

[0050] Step A22: If the frame buffer linked list is not empty, read the last linked list node to obtain the frame number Fn and the number of remaining time slots m of the frame;

[0051] Step A3: Calculate whether the remaining time slots can accommodate the message header length, as follows:

[0052] Step A31: If the remaining number of time slots can accommodate the message header length, calculate whether the remaining number of time slots in the frame can accommodate the length requested by the slave node, as follows:

[0053] Step A311: If the number of remaining time slots in the frame can accommodate the length requested by the slave node, record the slave node ID, update the starting time slot number to maxSlot-n, the number of occupied time slots n is the message length, and update the number of available time slots in the frame to mn;

[0054] Step A312: If the number of remaining time slots in the frame cannot accommodate the length requested by the slave node, record the slave node ID, update the starting time slot number to maxSlot-n, and occupy the time slot number , update the number of available time slots of the frame to 0;

[0055] Step A32: If the remaining number of time slots cannot accommodate the message header length, create a new linked list node with the linked list node ID of Fn+1, record the slave node ID, the starting time slot number is 1, the number of occupied time slots is the length of the message transmitted by the slave node, update the number of available time slots of the frame to maxSlot-n, and go to step A1.

[0056] By performing the operations described above, in view of the problem that general self-organizing networks usually do not have a fixed infrastructure, the master node needs to act as a relay node to forward data, and as the number of slave nodes increases, the transmission delay also increases accordingly. This solution improves the utilization rate of frame time slots and effectively reduces the delay by dynamically scheduling the position and length of the uplink data transmission channel and the downlink data transmission channel.

[0057] Example 5, see Figure 4 This embodiment is based on the fourth embodiment. Each linked list node in the frame cache linked list represents a frame of resource allocation data to be sent. When there are not enough resources for allocation of the Fn-th frame, a new linked list node is created to store the frame Fn+1. When the Fn-th frame interrupt signal arrives, the linked list node with the frame number Fn in the frame cache linked list is removed, and the resource response message in the linked list node is encapsulated and sent.

[0058] Example 6, see Figure 1 This embodiment is based on the above embodiment, a method for implementing a point-to-multipoint ad hoc network protocol stack, comprising the following steps:

[0059] Step S1: The protocol stack initiates a task and schedules each functional module;

[0060] Step S2: The master node establishes an ad hoc network to provide a communication connection between the master node and the slave nodes;

[0061] Step S3: The slave node starts and actively sends a heartbeat message to join the ad hoc network created by the master node. The master node authenticates the slave node. After the authentication is passed, the slave node establishes a connection with the master node and receives the broadcast message of the master node.

[0062] Step S4: The protocol stack monitors the heartbeat message and maintains the master-slave node neighbor association status; if the slave node loses connection with the master node, the protocol stack initiates a network scan request to the physical layer to match the new master node. After the match is successful, the slave node joins the new master node self-organizing network.

[0063] By executing the operations, the nodes in a general self-organizing network are dynamically moving, resulting in frequent changes in the network topology. The network protocol needs to constantly adapt to the new topology, resulting in complex routing selection. This solution sets the terminal slave node to send heartbeat messages to maintain the connection of the self-organizing network. The slave node can actively join the existing network or automatically switch to other new master node networks to adapt to flexible changes in the network topology.

[0064] Embodiment 7, see Figure 5 This embodiment is based on the above embodiment. In the data management module, downlink data transmission includes the following steps:

[0065] Step P1: Master node starts;

[0066] Step P2: The master node records the sequence number of the sent message;

[0067] Step P3: Fragment the message to be sent 4 times, and broadcast the fragmented message containing the target node ID, sequence number, fragment ID and offset to all slave nodes;

[0068] Step P4: Start from the node and prepare to receive shard messages;

[0069] Step P5: Determine whether the received message is the first fragment message. If it is the first fragment message, create a receiving queue for the message and set a timer. If all fragment messages are not received within the timer, discard the fragment message. Store the first fragment message in the receiving queue and record the sequence number of the broadcast message received from the master node.

[0070] Step P6: Determine whether the received message is the last fragment message and all fragment messages have been received; if so, the slave node combines the fragment messages into a complete message; if the currently received fragment message is not in the receiving queue, add the new fragment message to the receiving queue; if the currently received fragment message already exists, discard the fragment message;

[0071] Step P7: End the operation from the node.

[0072] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0073] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

[0074] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.

Claims

1. A point-to-multipoint ad hoc network protocol stack, characterized in that: It includes a fixed master node and multiple slave nodes, which form a star network topology through wireless connection. The data sent from the master node to the slave node is used as downlink data, and the data sent from the slave node to the master node is used as uplink data. The slave node continuously sends heartbeat messages to maintain the connection status with the master node; the master and slave nodes communicate with each other through a protocol stack, and the protocol stack is divided according to function, including a data management module, a network management module, a data forwarding control module, and a resource scheduling module; The data management module is responsible for the sending, receiving, encapsulating, fragmenting and reassembling of data; it includes a receiving end and a sending end, the receiving end receives the application layer data and encapsulates it into protocol stack data, and the sending end decapsulates the protocol stack data and forwards it to the application layer; The network management module manages the connection status of the ad hoc network, monitors the heartbeat messages to maintain the neighbor association status of the master and slave nodes, and processes the connection, disconnection and reconnection of the ad hoc network; The data forwarding control module manages the routing and forwarding strategies of data packets, including uplink data transmission, uplink control message transmission, downlink data transmission, and downlink control message transmission. Uplink data and downlink data include fragmentation and non-fragmentation. The resource scheduling module is responsible for the dynamic allocation of uplink data transmission channels. If other slave nodes have no data transmission at the current moment, all uplink data transmission channels are allocated to the current slave node for use; if more than one slave node needs to perform data transmission at the current moment, a dynamic allocation method is used to allocate frame time slots to the slave nodes, and the slave nodes encapsulate uplink data according to the allocated frame time slot length; When the length of uplink data and downlink data transmission exceeds the maximum length of physical layer transmission, the data forwarding control module performs data fragmentation processing: downlink data is fragmented according to a fixed length, encrypted and transmitted in a broadcast manner, and each fragment is retransmitted according to the configured number of retransmissions; The uplink data sends a resource scheduling request based on the remaining length of the data, and is fragmented, encapsulated and encrypted according to the data length allocated in the resource scheduling response message. The ACK message is used to confirm whether retransmission is required. The master node decrypts the fragments after receiving them, reassembles the data after receiving all the fragments, and forwards it to the application layer; In the resource scheduling module, the dynamic allocation method adopts the method of applying first and then using: the slave node sends an application to the master node, the master node allocates resources to the slave node according to the current resource occupancy situation, the slave node transmits uplink data according to the dynamic resources allocated by the master node, and uses the resource request queue to store the application information of the slave node; the master node uses the frame buffer linked list to record the frames that have completed resource allocation and the resource allocation response information that needs to be issued, and the linked list nodes represent the resource allocation data to be sent for each frame. The specific steps are as follows: Step A1: The master node reads the resource request queue and determines whether the queue is empty. If the queue is empty, the scheduling ends; if the queue is not empty, step A2 is executed; Step A2: Determine whether the frame buffer linked list is empty, as follows: Step A21: If the frame buffer linked list is empty, create a new linked list node, the linked list node ID is the global frame number, record the slave node ID, the starting time slot number is 1, the number of occupied time slots n is the length of the message transmitted by the slave node, update the number of available time slots of the frame to maxSlot-n, maxSlot represents the maximum number of time slots, and go to step A1; Step A22: If the frame buffer linked list is not empty, read the last linked list node to obtain the frame number Fn and the number of remaining time slots m of the frame; Step A3: Calculate whether the remaining time slots can accommodate the message header length, as follows: Step A31: If the remaining number of time slots can accommodate the message header length, calculate whether the remaining number of time slots in the frame can accommodate the length requested by the slave node, as follows: Step A311: If the number of remaining time slots in the frame can accommodate the length requested by the slave node, record the slave node ID, update the starting time slot number to maxSlot-n, the number of occupied time slots n is the message length, and update the number of available time slots in the frame to mn; Step A312: If the number of remaining time slots in the frame cannot accommodate the length requested by the slave node, record the slave node ID, update the starting time slot number to maxSlot-n, the number of occupied time slots, and update the number of available time slots in the frame to 0; Step A32: If the remaining number of time slots cannot accommodate the message header length, create a new linked list node with the linked list node ID of Fn+1, record the slave node ID, the starting time slot number is 1, the number of occupied time slots is the length of the message transmitted by the slave node, update the number of available time slots of the frame to maxSlot-n, and go to step A1.

2. A point-to-multipoint ad hoc network protocol stack according to claim 1, characterized in that: In the data management module, the protocol stack data is divided into a fixed header part and a payload part: the fixed header part has a length of 10B; the payload part has a variable length and is used to carry transmission data.

3. A method for implementing a point-to-multipoint ad hoc network protocol stack, for implementing a point-to-multipoint ad hoc network protocol stack as claimed in any one of claims 1 to 2, characterized in that: The following steps are involved: Step S1: The protocol stack initiates a task and schedules each functional module; Step S2: The master node establishes an ad hoc network to provide a communication connection between the master node and the slave nodes; Step S3: The slave node starts and actively sends a heartbeat message to join the ad hoc network created by the master node. The master node authenticates the slave node. After the authentication is passed, the slave node establishes a connection with the master node and receives the broadcast message of the master node. Step S4: The protocol stack monitors the heartbeat message and maintains the master-slave node neighbor association status; If the slave node loses connection with the master node, the protocol stack initiates a network scan request to the physical layer to match the new master node. After a successful match, the slave node joins the new master node self-organizing network.