Method, device and medium for optimizing communication of embedded platform ad hoc network equipment

CN121217573BActive Publication Date: 2026-09-29湖南智领通信科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511647454.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-09-29
Estimated Expiration
2045-11-11

AI Technical Summary

Technical Problem

[0003]然而,在此数据通信过程中,数据需先后经过主机协议栈、电台有线网口协议栈、桥接转发环节及无线网口协议栈的多层处理,且在不同层级传递时均需执行封装、解封装操作,同时协议栈内部不同层之间还需频繁进行数据复制,这不仅导致数据传输时延大幅增加、设备内存占用量过高,还造成显著的性能损耗;此外,当系统出现故障需要debug时,工作人员需对各层级逐一展开分析,极大提升了故障定位的难度,难以满足嵌入式自组网设备对高效通信及便捷运维的实际需求

Benefits of technology

1.通过在FreeRTOS系统的同一线程中注册有线网卡与无线网卡,并使两网卡接收接口直接调用对方发送接口转发数据,仅保留“主机协议栈封装、网卡直接透传、另一主机协议栈解封装”的核心流程,省去了Linux系统下协议栈多层交互及数据复制环节,显著缩短数据传输路径,降低传输时延,减少设备内存因数据重复拷贝产生的占用量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121217573B_ABST
    Figure CN121217573B_ABST
Patent Text Reader

Abstract

The application relates to an embedded platform ad hoc network device communication optimization method, device, equipment and medium, and relates to the technical field of ad hoc network communication. The method comprises the following steps: starting a FreeRTOS system in an embedded platform ad hoc network device, and registering a wired network card and a wireless network card in a thread; after the wired network card receives network data encapsulated by a host protocol stack, identifying a message type, calling a sending interface of the wireless network card to forward data to other network devices or submitting the data to an LWIP protocol stack for processing according to an IP address; after the wireless network card receives network data sent by other network devices, identifying a message type; and calling a sending interface of the wired network card to forward data to a local host or submitting the data to an LWIP protocol stack for processing according to an IP address. The application can reduce transmission delay and memory occupation and reduce performance loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ad hoc network communication technology, and in particular to a communication optimization method, apparatus, device, and medium for embedded platform ad hoc network devices. Background Technology

[0002] In embedded ad hoc network applications, the device radio typically runs on a Linux system. The host needs to communicate with the ad hoc network radio via the network port. The existing data transmission process is as follows: The host transmitter PC1 first processes the data through its own network protocol stack and encapsulates it into IP packets or other formats suitable for transmission. Then, it sends the data to its own radio via the network port. The radio receives the data via the wired network eth0 and uses network card bridging to achieve data transmission between wired and wireless networks. Subsequently, it forwards the data to the peer radio via the wireless network card mesh0. The peer radio receives the data via the wireless network card mesh0 and also transmits the data to the wired network card eth0 via network card bridging. The wired network card then sends the data to the corresponding network port. The host receiver PC2 receives the data from the network port, decapsulates it through its own network protocol stack, and then hands it over to the application for processing.

[0003] However, in this data communication process, the data needs to go through multiple layers of processing, including the host protocol stack, the radio wired network port protocol stack, the bridging and forwarding stage, and the wireless network port protocol stack. Encapsulation and decapsulation operations are required at each layer, and data copying is also frequently required between different layers within the protocol stack. This not only leads to a significant increase in data transmission latency and excessive device memory usage, but also causes significant performance loss. In addition, when the system malfunctions and needs debugging, staff need to analyze each layer one by one, which greatly increases the difficulty of fault location and makes it difficult to meet the actual needs of embedded self-organizing network devices for efficient communication and convenient operation and maintenance. Summary of the Invention

[0004] Therefore, it is necessary to provide a communication optimization method, apparatus, device, and medium for embedded platform self-organizing network devices that can reduce transmission latency and memory usage and reduce performance loss, in order to address the above-mentioned technical problems.

[0005] A communication optimization method for embedded platform self-organizing network devices, the method comprising: Start the FreeRTOS system in the embedded platform self-organizing network device, create a thread, register the wired network card and the wireless network card in the thread, and associate the receiving interface and the transmitting interface of the wired network card and the wireless network card with the corresponding interface functions respectively. After receiving network data encapsulated by the host protocol stack, the wired network card obtains the data header information and identifies the packet type through the receiving interface. If it is an ARP packet, and the corresponding IP address is determined to be a broadcast address and the destination IP is not the local device IP in this network segment, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing. If it is an IP packet, and the destination MAC address is determined to be not the local device MAC address, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing. After receiving network data sent by other networking devices, the wireless network card obtains the data header information and identifies the packet type through the receiving interface. If it is an ARP packet, and it is determined that the corresponding IP address is a broadcast address and the destination IP is not the local device IP in this network segment, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing. If it is an IP packet, and it is determined that the corresponding destination MAC address is not the local device MAC address, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing.

[0006] On the other hand, an embedded platform self-organizing network device communication optimization device is also provided, comprising: The thread construction module is used to start the FreeRTOS system in the embedded platform self-organizing network device, create threads, register wired network cards and wireless network cards in the threads, and associate the receiving interface and transmitting interface of the wired network card and the wireless network card with the corresponding interface functions respectively. The wired network card communication module is used to receive network data encapsulated by the host protocol stack, obtain data header information and identify the packet type through the receiving interface; if it is an ARP packet, and it is determined that the corresponding IP address is a broadcast address and the destination IP is not the local device IP in the local network segment, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing; if it is an IP packet, and it is determined that the destination MAC address is not the local device MAC address, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing. The wireless network card communication module is used to obtain data header information and identify the packet type through the receiving interface after the wireless network card receives network data sent by other networking devices. If it is an ARP packet, and it is determined that the corresponding IP address is a broadcast address and the destination IP is not the IP of the local device in the same network segment, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing. If it is an IP packet, and it is determined that the corresponding destination MAC address is not the MAC address of the local device, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing.

[0007] In another aspect, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described embedded platform self-organizing network device communication optimization method.

[0008] Furthermore, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described embedded platform self-organizing network device communication optimization method.

[0009] Compared with existing technologies, the embedded platform self-organizing network device communication optimization method, apparatus, device, and medium provided by this invention have the following beneficial effects: 1. By registering wired and wireless network cards in the same thread of the FreeRTOS system, and enabling the receiving interfaces of the two network cards to directly call the sending interface of the other to forward data, only the core process of "host protocol stack encapsulation, network card direct pass-through, and other host protocol stack decapsulation" is retained. This eliminates the multi-layer interaction of the protocol stack and data copying in the Linux system, significantly shortening the data transmission path, reducing transmission latency, and reducing the amount of device memory occupied by repeated data copying.

[0010] 2. The design of directly calling the network card's underlying interface eliminates redundant processing steps of the wired network port protocol stack, bridging link, and wireless network port protocol stack on the radio side. The LWIP protocol stack is only submitted when data is directed to the local device, which reduces the performance consumption caused by protocol stack processing, improves the communication efficiency of the embedded platform's self-organizing network device, and reduces performance loss.

[0011] 3. The data transmission process in this application only involves three core links: "host protocol stack, direct forwarding of dual network cards, and protocol stack of another host". The sending and receiving logic of the dual network cards is concentrated in the same thread of the FreeRTOS system. The data flow is clear and traceable. There is no need to check each multi-layer protocol stack one by one. Staff can quickly track the data sending and receiving link, simplify the fault location process, and reduce the difficulty of operation and maintenance.

[0012] 4. By simplifying the data processing link, the number of interaction nodes between protocol stack layers is reduced, thereby reducing the risk of performance instability caused by multi-layer adaptation. At the same time, the LWIP protocol stack is only called when data is directed to the local machine, which reduces the frequency of protocol stack calls and further improves the stability of communication performance, making it more in line with the actual needs of embedded self-organizing network devices for continuous and efficient communication. Attached Figure Description

[0013] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention, and those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0014] Figure 1 This is a flowchart illustrating a communication optimization method for an embedded platform ad hoc network device in one embodiment; Figure 2 This is a structural block diagram of an embedded platform self-organizing network device communication optimization device in one embodiment; Figure 3 This is an internal structural diagram of a computer device in one embodiment.

[0015] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0017] It should be noted that in this invention, the use of terms such as "first," "second," etc., is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0018] It is understood that the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0019] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0020] Example 1 like Figure 1 As shown, this embodiment provides a communication optimization method for embedded platform self-organizing network devices, including the following steps: Step 201: Start the FreeRTOS system in the embedded platform self-organizing network device, create a thread, register the wired network card and the wireless network card in the thread, and associate the receiving interface and the transmitting interface of the wired network card and the wireless network card with the corresponding interface functions respectively.

[0021] Step 202: After the wired network card receives the network data encapsulated by the host protocol stack, it obtains the data header information and identifies the packet type through the receiving interface. If it is an ARP packet, and it is determined that the corresponding IP address is a broadcast address and the destination IP is not the IP of the local device in the same network segment, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing. If it is an IP packet, and it is determined that the destination MAC address is not the MAC address of the local device, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing.

[0022] Step 203: After receiving network data sent by other networking devices, the wireless network card obtains the data header information and identifies the packet type through the receiving interface. If it is an ARP packet, and the corresponding IP address is determined to be a broadcast address and the destination IP is not the local device IP in this network segment, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing. If it is an IP packet, and the corresponding destination MAC address is determined to be not the local device MAC address, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing.

[0023] In the specific implementation of step 201, after the FreeRTOS system is started in the embedded platform self-organizing network device, the system will quickly complete initialization and create a dedicated thread. Within this dedicated thread, wired and wireless network cards will be registered using `netif_add`. During registration, the network card addition function is called to create the first network card structure `netif1` for the wired network card and the second network card structure `netif2` for the wireless network card.

[0024] Then, these two network interface card (NIC) structures are added to the global NIC linked list netif_list, and the receive interface field and transmit interface field of the first NIC structure netif1 and the second NIC structure netif2 are respectively pointed to the underlying data link transceiver function. In this way, the receive interfaces of wired and wireless NICs can call each other's transmit interface functions. In addition, data that has been encapsulated once by the host protocol stack can be transparently transmitted between multiple NICs.

[0025] The underlying data link transceiver functions include the wired network card receive interface function xemacpsif_input for wired network card data reception, the wired network card send interface function eth0->linkoutput() for wired network card data transmission, the wireless network card receive interface function meshf_input for wireless network card data reception, and the wireless network card send interface function mesh->linkoutput() for wireless network card data transmission.

[0026] Specifically, the receive interface field of the first network card structure netif1 is associated with the wired network card receive interface function xemacpsif_input, and the send interface field is associated with the wired network card send interface function eth0->linkoutput(); the receive interface field of the second network card structure netif2 is associated with the wireless network card receive interface function meshf_input, and the send interface field is associated with the wireless network card send interface function mesh->linkoutput().

[0027] This step achieves transparent visibility of the network card management send / receive interface by centrally registering multiple network cards in the same thread and associating them with corresponding interface functions. This lays the foundation for subsequent direct calls between network cards to forward data. At the same time, by leveraging the fast startup feature of the FreeRTOS system, the device can quickly enter the network preparation state after power-on, improving networking efficiency.

[0028] In the specific implementation of step 202, when wired network card data needs to be sent to other networking devices, the original network data encapsulated by the host protocol stack is received from the network interface chip through the wired network card receiving interface function xemacpsif_input. After receiving, the type of the pbuf type network data packet corresponding to the original network data is first verified. After the verification is successful, the data header information is obtained and the packet type is identified through the wired network card receiving interface function xemacpsif_input.

[0029] When an ARP packet is identified, it is determined whether the IP address corresponding to the ARP packet is a broadcast address and whether the destination IP is not a local device IP in the same network segment. If so, the wireless network card sending interface function mesh->linkoutput() is directly called to submit the pbuf data packet to the FPGA PHY layer and then send it to other networking devices for processing. If not, the data packet is submitted to the LWIP protocol stack for processing, and wireless forwarding is not required.

[0030] When an IP packet is identified, it is determined whether the destination MAC address of the IP packet is the MAC address of the local device. If not, the wireless network card sending interface function mesh->linkoutput() is called directly to submit the pbuf data packet to the PHY layer of the FPGA and then send it to other networking devices for processing. If it is, it is submitted to the LWIP protocol stack for processing, and wireless forwarding is not required.

[0031] This step eliminates the need for data to be processed and bridged by the radio's wired network protocol stack under Linux, avoiding data copying and encapsulation between multiple layers of the protocol stack, significantly reducing transmission latency and memory usage, while also minimizing performance loss.

[0032] In the specific implementation of step 203, when the data received by the wireless network card needs to be sent to an external wired device, the wireless network card receives network data sent by other networking devices through the wireless network card receive interface function meshif_input. After receiving, it first identifies whether the network data is a networking data packet or a network data packet. If it is a networking data packet, it directly performs networking processing; if it is a network data packet, it obtains the data header information and identifies the packet type through the wireless network card receive interface function meshif_input.

[0033] When an ARP packet is identified, if the corresponding IP address of the ARP packet is a broadcast address and the destination IP is not the IP address of the local device in the same network segment, the wired network card sending interface function eth0->linkoutput() is called to forward the data to the local host; otherwise, the data is submitted to the LWIP protocol stack for processing and wireless forwarding is not required.

[0034] When an IP packet is identified, it is determined whether the destination MAC address of the IP packet is the MAC address of the local device. If so, the wired network card sending interface function eth0->linkoutput() is directly called to forward the data to the local host. If not, the data is submitted to the LWIP protocol stack for processing and wireless forwarding is not required.

[0035] This step enables direct data forwarding between the wireless and wired network cards, simplifying the data transmission process and making the data flow clear and traceable. This not only improves communication efficiency but also makes it easier for staff to track the data transmission and reception links and reduces the difficulty of fault location.

[0036] One embodiment also includes a judgment logic for multi-NIC data interaction: when the wired NIC receive interface function xemacpsif_input and the wireless NIC receive interface function meshif_input receive network data packets, the destination IP of the data packets will be judged and verified first. If the current data IP address is consistent with the IP of this NIC and is not a broadcast address, its sending interface function will not be called; otherwise, data transmission between multiple NICs will be performed.

[0037] This embodiment enables precise control of data forwarding paths, avoids invalid data forwarding operations, further improves the efficiency and accuracy of data transmission, and reduces unnecessary performance loss.

[0038] It should be understood that, although this embodiment Figure 1 The steps are shown sequentially as indicated by the arrows, but they are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order in which these steps are performed; they can be executed in other orders. Figure 1At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0039] Example 2 Based on the embedded platform ad hoc network device communication optimization method in Embodiment 1, this embodiment discloses an embedded platform ad hoc network device communication optimization device, such as... Figure 2 As shown, the embedded platform self-organizing network device communication optimization device includes: a thread construction module 401, a wired network card communication module 402, and a wireless network card communication module 403, wherein: The thread building module 401 is used to start the FreeRTOS system in the embedded platform self-organizing network device, create threads, register wired network cards and wireless network cards in the threads, and associate the receiving interface and transmitting interface of the wired network card and wireless network card with the corresponding interface functions respectively.

[0040] The wired network card communication module 402 is used to receive network data encapsulated by the host protocol stack, obtain the data header information and identify the packet type through the receiving interface. If it is an ARP packet, and it is determined that the corresponding IP address is a broadcast address and the destination IP is not the IP of the local device in the same network segment, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing. If it is an IP packet, and it is determined that the destination MAC address is not the MAC address of the local device, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing.

[0041] The wireless network card communication module 403 is used to receive network data sent by other networking devices, obtain the data header information and identify the packet type through the receiving interface; if it is an ARP packet, if it is determined that the corresponding IP address is a broadcast address and the destination IP is not the local device IP in the local network segment, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing; if it is an IP packet, if it is determined that the corresponding destination MAC address is not the local device MAC address, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing.

[0042] In this embodiment, the specific working process and working principle of modules A, B, and C are the same as those in embodiment 1, so they will not be described again in this embodiment. Each unit module can be implemented entirely or partially through software, hardware, or a combination thereof. Each unit module can be embedded in the processor of the computer device in hardware form or independent of it, or it can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above unit modules.

[0043] Example 3 like Figure 3 The diagram illustrates a terminal device disclosed in this embodiment, comprising a transmitter, a receiver, a memory, and a processor. The transmitter transmits instructions and data, the receiver receives instructions and data, the memory stores computer-executed instructions, and the processor executes the computer-executed instructions stored in the memory to implement the method described in Embodiment 1 above.

[0044] It is important to note that the aforementioned memory can be either standalone or integrated with the processor. When the memory is set up independently, the terminal device also includes a bus for connecting the memory and the processor.

[0045] Example 4 This embodiment discloses a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the method in Embodiment 1 above.

[0046] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0047] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0048] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and optimizations without departing from the concept of the present invention, and these modifications and optimizations all fall within the scope of protection of the present invention.

Claims

1. A communication optimization method for embedded platform self-organizing network devices, characterized in that, The method includes: Start the FreeRTOS system in the embedded platform self-organizing network device, create a thread, register the wired network card and the wireless network card in the thread, and associate the receiving interface and the transmitting interface of the wired network card and the wireless network card with the corresponding interface functions respectively. After receiving network data encapsulated by the host protocol stack, the wired network card obtains the data header information and identifies the packet type through the receiving interface. If it is an ARP packet, and the corresponding IP address is determined to be a broadcast address and the destination IP is not the local device IP in this network segment, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing. If it is an IP packet, and the destination MAC address is determined to be not the local device MAC address, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing. After receiving network data sent by other networking devices, the wireless network card obtains the data header information and identifies the packet type through the receiving interface. If it is an ARP packet, and it is determined that the corresponding IP address is a broadcast address and the destination IP is not the local device IP in this network segment, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing. If it is an IP packet, and it is determined that the corresponding destination MAC address is not the local device MAC address, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing.

2. The embedded platform self-organizing network device communication optimization method according to claim 1, characterized in that, Registering wired and wireless network cards in the thread includes: Call the network card addition function to create the first network card structure corresponding to the wired network card, and create the second network card structure corresponding to the wireless network card; Add the first network interface card (NIC) structure and the second NIC structure to the global NIC linked list, and point the receive interface field and send interface field of the first NIC structure and the second NIC structure to the underlying data link transceiver function, respectively.

3. The embedded platform self-organizing network device communication optimization method according to claim 2, characterized in that, The underlying data link transmit / receive functions include: Wired network card receive interface functions for wired network card data reception, wired network card send interface functions for wired network card data transmission, wireless network card receive interface functions for wireless network card data reception, and wireless network card send interface functions for wireless network card data transmission.

4. The embedded platform self-organizing network device communication optimization method according to claim 3, characterized in that, The receive interface field of the first network card structure is associated with the wired network card receive interface function, and the receive interface field of the second network card structure is associated with the wireless network card receive interface function.

5. The embedded platform self-organizing network device communication optimization method according to claim 3 or 4, characterized in that, The wired network card receives network data encapsulated by the host protocol stack, including: The wired network card receives raw network data encapsulated by the host protocol stack from the network port chip through the wired network card receive interface function.

6. The embedded platform self-organizing network device communication optimization method according to claim 5, characterized in that, After receiving the raw network data encapsulated by the host protocol stack from the network interface chip via the wired network card's receive interface function, it also includes: The pbuf type network data packet corresponding to the original network data is verified. After the verification is successful, the data header information is obtained through the receiving interface and the packet type is identified.

7. The embedded platform self-organizing network device communication optimization method according to claim 3 or 4, characterized in that, The wireless network card receives network data sent by other networking devices, including: The wireless network card receives network data sent by other networking devices through the wireless network card receive interface function. First, it identifies whether the network data is a networking data packet; if so, it performs networking processing; if not, it obtains the data header information and identifies the message type through the receive interface function.

8. A communication optimization device for an embedded platform self-organizing network device, characterized in that, The device includes: The thread construction module is used to start the FreeRTOS system in the embedded platform self-organizing network device, create threads, register wired network cards and wireless network cards in the threads, and associate the receiving interface and transmitting interface of the wired network card and the wireless network card with the corresponding interface functions respectively. The wired network card communication module is used to receive network data encapsulated by the host protocol stack, obtain data header information and identify the packet type through the receiving interface; if it is an ARP packet, and it is determined that the corresponding IP address is a broadcast address and the destination IP is not the local device IP in the local network segment, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing; if it is an IP packet, and it is determined that the destination MAC address is not the local device MAC address, the wireless network card's sending interface is called to forward the data to other network devices; otherwise, it is submitted to the LWIP protocol stack for processing. The wireless network card communication module is used to obtain data header information and identify the packet type through the receiving interface after the wireless network card receives network data sent by other networking devices. If it is an ARP packet, and it is determined that the corresponding IP address is a broadcast address and the destination IP is not the IP of the local device in the same network segment, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing. If it is an IP packet, and it is determined that the corresponding destination MAC address is not the MAC address of the local device, the wired network card's sending interface is called to forward the data to the local host; otherwise, it is submitted to the LWIP protocol stack for processing.

9. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the embedded platform self-organizing network device communication optimization method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a processor, implements the steps of the embedded platform self-organizing network device communication optimization method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Network connection establishment method and electronic equipment

    CN112333733A

  • Virtual point-to-point network data sending, receiving and answering methods and system thereof

    CN113794715A