Multi-channel adaptive communication controller based on STM32 platform

By designing a multi-channel adaptive pass controller based on the STM32 platform, real-time perception and dynamic adjustment of network topology and channel quality are achieved, and the existing pass controllers are solved, and network communication efficiency and user experience are improved.

CN119835204APending Publication Date: 2025-04-15NO 50 RES INST OF CHINA ELECTRONICS TECH GRP

Patent Information

Application Number
CN202411841728.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing bus controllers are expensive and lack network topology awareness capabilities and channel awareness functions, resulting in low network communication efficiency and unstable data transmission, affecting the user experience and normal business development.

Method used

A multi-channel adaptive pass controller based on the STM32 platform is designed, including user interaction module, topology awareness module, subnet division module, channel awareness module, routing generation module, data forwarding module and working status monitoring module to realize real-time perception of network topology structure, monitoring of channel quality and dynamic routing adjustment.

Benefits of technology

It effectively reduces the consumption of software and hardware resources, realizes timely response and routing adjustments to network topology changes, improves network communication efficiency, reduces transmission delay and congestion, and enhances communication quality and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835204A_ABST
    Figure CN119835204A_ABST
Patent Text Reader

Abstract

The invention provides a multi-channel adaptive communication controller based on an STM32 platform. The multi-channel adaptive communication controller comprises a user interaction module, a topology sensing module, a subnet division module, a channel sensing module, a route generation module, a data forwarding module and a working state monitoring module. The user interaction module is used for realizing interaction between a user and the communication controller; the topology sensing module is used for sensing the topology structure of a network where the communication controller is located in real time; if the communication controller automatically divides the subnets, the subnet dividing module divides the subnets according to the topological structure of the network acquired by the topology sensing module; the channel sensing module is used for monitoring the communication quality of a channel currently used by a network in real time; the data forwarding module is used for realizing a routing forwarding function; the working state monitoring module is used for monitoring the working state of the communication controller. Based on the topology sensing function, when the network topology changes, the routing can be adjusted in time, network delay and network congestion are avoided, meanwhile, a basis is provided for subnet division, and the workload of subnet configuration of a user is relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet communications, and in particular to a multi-channel adaptive communication controller based on an STM32 platform. Background Art

[0002] In today's era of rapid technological development, communication controllers play a key role in many fields. In the design and implementation process of traditional communication controllers, most tend to use chips equipped with memory management units (MMUs) such as cortex-A or ARM9 as the main control chip, and rely on operating systems such as Linux / VxWorks to process tasks and conduct network communications. However, such chips are expensive, which greatly increases the manufacturing cost of communication controllers. For enterprises, the high cost limits the market competitiveness and large-scale promotion and application of products, highlighting the urgency of developing new communication controllers from an economic perspective.

[0003] Furthermore, existing communication controllers generally lack network topology awareness. In actual network application scenarios, the network topology often changes. Since the communication controller cannot detect these changes in time, it is difficult to quickly adjust the routing table or routing strategy. It often takes a long time delay to generate a new routing strategy to adapt to the change in network topology. During this period, the efficiency of network communication will be greatly reduced, and data transmission may be stuck, interrupted, and other undesirable phenomena, which seriously affect the user experience and the normal development of related businesses, indicating a strong demand for communication controllers with network topology awareness functions. In addition, the existing communication controller lacks channel perception function. When the communication quality of the channel currently being used in the network decreases due to interference, signal attenuation and other factors, the communication controller cannot perceive the change in channel quality in time, and cannot switch to other better channels in the first time, and re-plan the route accordingly. In this way, the communication quality of the entire network will inevitably be affected, and the accuracy and timeliness of data transmission will be difficult to guarantee. This is extremely unfavorable in application scenarios with high requirements for communication quality. It further emphasizes the necessity of studying communication controllers that can perceive channel communication quality and switch channels and adjust routing strategies in time.

[0004] Through searching patent documents, it was found that the invention patent with publication number CN104883691B discloses an adaptive dynamic subnet division method in a wireless sensor network, including the following steps: the wireless sensor network divides the wireless sensor into several independent subnets based on the distance, and establishes a routing table based on this to start data transmission; in the data communication process, the number of data requests n initiated by each node and the total amount of data exchanged by the data request c are recorded at intervals of time T, and then the current busyness fc of a node within time T is calculated based on this parameter; finally, based on the number of nodes and the busyness, each sensor subnet is dynamically adjusted so that the number of sensor nodes in each subnet and the sum of the busyness of all nodes in the subnet reach the maximum approximation. This patent mainly focuses on the subnet division method, which is imperfect in the overall network control multi-functional coordination and lacks channel perception function.

[0005] In summary, in view of the above problems in the prior art, studying a multi-channel adaptive communication controller based on the STM32 platform has become a key task that needs to be solved urgently. Summary of the invention

[0006] In view of the defects in the prior art, an object of the present invention is to provide a multi-channel adaptive communication controller based on the STM32 platform.

[0007] According to the present invention, a multi-channel adaptive communication controller based on the STM32 platform includes: a user interaction module, a topology perception module, a subnet division module, a channel perception module, a routing generation module, a data forwarding module and a working status monitoring module;

[0008] The user interaction module is used to realize the interaction between the user and the communication controller;

[0009] The topology perception module is used to perceive the topology of the network where the communication controller is located in real time. When the communication controller is started, the topology perception module detects the topology of the network and transmits the topology to the user interaction module; when the topology of the network changes, the topology perception module sends the changed topology perceived in real time to the user interaction module, the subnet division module and the route generation module;

[0010] The subnet division module determines the subnet division method according to the user configuration. The subnet division methods include manual subnet division by the user and automatic subnet division by the communication controller. If the communication controller automatically divides the subnet, the subnet division module divides the subnet according to the topological structure of the network obtained by the topology perception module.

[0011] The channel sensing module is used to monitor the communication quality of the channel currently used by the network in real time. When the communication quality drops below a specific threshold, the channel sensing module detects the communication quality of each channel in the network, selects the channel with the best communication quality, and notifies other devices in the network to switch communication channels;

[0012] The routing generation module determines the adaptive routing algorithm based on user configuration and the current network topology. The available routing strategies include manually configured routing table entries, RIP routing algorithm and OSPF routing algorithm.

[0013] The data forwarding module is used to implement the routing forwarding function. When the communication controller receives the message sent from each port, it will query the routing table according to the destination address in the message and forward the message according to the next hop address in the routing table entry;

[0014] The working status monitoring module is used to monitor the working status of the communication controller.

[0015] Preferably, the multi-channel adaptive communication controller is based on the STM32H743Z platform.

[0016] Preferably, the user interaction module is constructed in the form of a micro server, including a front end and a back end;

[0017] The front end is presented in the form of a panel and HTML web page;

[0018] The backend receives the data encapsulated into SLIP frames by the frontend through the serial port and parses it. The frontend and backend customize the interaction protocol to ensure accurate transmission and processing of information.

[0019] Preferably, the topology perception module includes a detection packet sending and receiving submodule and a topology analysis submodule;

[0020] The detection packet sending and receiving submodule is based on the LWIP protocol stack. It sends detection packets based on ARP and IP protocols on the wired channel and the wireless channel at the same time. It first locates the network node directly connected to the communication controller, and then continues to send detection packets to detect other nodes connected to the directly connected network node until there are no subsequent nodes or a new communication controller is encountered. The connection information between the communication controller and the directly connected network node, and between the directly connected network node and other nodes is stored in the memory in a list data structure.

[0021] After reading the connection information in the list, the topology parsing submodule generates a directed acyclic graph structure according to the Kahn algorithm and sends the directed acyclic graph structure to the module that needs the network topology.

[0022] Preferably, the subnet division module is constructed based on the LWIP protocol stack, and the subnet division module implements the subnet division function including the following steps:

[0023] Step S1, read the user configuration, and determine whether the user requires manual subnet division or the communication controller automatically divides the subnet;

[0024] Step S2: If the user requires manual subnet division, the subnet division module generates a VLAN number according to the user configuration;

[0025] Step S3, if the user requires the communication controller to automatically divide the subnet, the subnet division module reads the topology map generated by the topology analysis submodule, determines the current network topology structure, determines the terminal set that can be divided into the same subnet according to the current network topology structure, and then assigns a unique VLAN number to the divided subnet. The communication controller then transmits the VLAN number to the terminal in the same subnet, and the data exchanged between the terminal and the communication controller will be encapsulated into the link layer frame carrying the VLAN number;

[0026] Step S4, sending the divided subnet information to the user interaction module.

[0027] Preferably, the channel sensing module includes a channel detection submodule and a channel selection submodule;

[0028] The channel detection submodule sends a handshake packet to the terminal through the network cable or channel device based on a preset time interval. After receiving the handshake packet, the terminal returns a handshake response packet. The channel detection submodule counts the packet loss rate to detect the communication quality of the current channel in real time. If the packet loss rate of the communication controller and a terminal is higher than a preset threshold, the channel detection submodule will pass the message that the packet loss rate between the communication controller and a terminal is higher than the preset threshold to the channel selection submodule.

[0029] The channel selection submodule is used to reselect the communication channel between the communication controller and the specific terminal. After receiving the message, the channel selection submodule sends a channel detection frame to the terminal in each frequency band of the wired network and the wireless network. According to the number of responses of each terminal to the channel detection frame, the channel with the lowest packet loss rate, that is, the channel with the best communication quality, is selected as the new channel for communicating with the terminal, and the channel switching information is sent to the topology perception module. At the same time, the data transmission process with the terminal is restarted with the new channel.

[0030] Preferably, the route generation module reads the user configuration and determines the route generation mode, which includes manual route generation and automatic route generation by the communication controller. If the route is manually generated, the communication controller generates a routing table according to the routing entries filled in by the user; if the route is automatically generated by the communication controller, the route generation module reads the topology structure of the network obtained by the topology perception module, and selects an adaptive routing algorithm according to the topology structure to generate a routing table; when the topology structure of the network changes, the topology perception module sends the changed topology structure to the route generation module as soon as possible, and the route generation module generates new route entries after receiving the changed topology structure; when the topology structure of the network changes significantly, the route generation module reselects a suitable routing algorithm according to the changed topology structure and generates new route entries; when the communication controller switches channels due to poor communication quality, the route generation module updates the route entries in the routing table according to the new topology structure after switching channels.

[0031] Preferably, the route generation module includes a route algorithm selection submodule and a route generation submodule; the route algorithm selection submodule determines the generation method of the route table item according to the user configuration, if the user selects to manually generate the route table item, the route generation submodule generates it according to the user input; if the user selects the communication controller to automatically generate the route table item, the route algorithm selection submodule selects an adaptive route algorithm according to the topological structure of the current network;

[0032] The routing generation submodule generates corresponding routing table entries according to the routing algorithm selected by the routing selection module. When automatically generating routing table entries, the routing generation module first generates some routing table entries according to the topology structure generated by the topology perception module. Then, the communication controller sends query messages to adjacent communication controllers to generate routing table entries for accessing other networks. When manually generating routing table entries, the routing generation module generates routing table entries according to user input. After determining the routing algorithm, the routing generation submodule uses the routing algorithm and combines the acquired topology type to generate routing table entries.

[0033] Preferably, the data forwarding module is built based on the LWIP protocol stack, and the working process includes the following steps:

[0034] Step M1: After receiving the message transmitted by the terminal to the communication controller, the data forwarding module parses the message according to the LWIP protocol stack to obtain the source address, destination address and next hop address in the message;

[0035] Step M2, searching the corresponding routing table entry in the memory according to the destination address in the message, if the routing table entry corresponding to the destination address is found, then adding the next hop address in the routing table entry to the data packet to be forwarded, and forwarding the data packet from the port corresponding to the routing table entry;

[0036] Step M3, if no routing table entry corresponding to the destination address is found, the communication controller sends a query message to the adjacent communication controller to query whether the adjacent communication controller has a routing table entry corresponding to the destination address of the message. If so, the routing table entry is sent to the current communication controller, and the routing generation module is responsible for updating the routing table entry; if there is no corresponding routing table entry, the data forwarding module discards the data packet and sends a message to the source address to notify the source address that data forwarding has failed.

[0037] Preferably, the working state detection module includes a state detection module and an abnormal response module;

[0038] The state detection module periodically reads the variables representing the state of the communication controller in each module through a preset timing mechanism to obtain the state of the communication controller;

[0039] The exception response module responds to the controller exception in real time by setting a callback function.

[0040] Compared with the prior art, the present invention has the following beneficial effects:

[0041] 1) The present invention is built on the STM32 platform, which effectively reduces the consumption of software and hardware resources.

[0042] 2) Based on the topology perception function, the present invention can adjust the route in time when the network topology changes, reduce invalid routes, avoid network delays and network congestion, and provide a basis for subnet division, reducing the workload of users in configuring subnets.

[0043] 3) The present invention is based on a traffic monitoring module, and the communication controller can detect the communication quality between each device (subnet) in real time. When the communication quality deteriorates, it can switch channels and modify routes in real time to reduce the overall transmission delay of the network. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0045] Figure 1 is a schematic diagram of a user interaction module in an embodiment of the present invention;

[0046] Figure 2 is an example diagram of a network structure in an embodiment of the present invention;

[0047] Figure 3 Schematic diagram of network topology in an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0049] Embodiment 1:

[0050] This embodiment provides a multi-channel adaptive communication controller based on the STM32 platform, including: a user interaction module, a topology perception module, a subnet division module, a channel perception module, a routing generation module, a data forwarding module and a working status monitoring module.

[0051] In this embodiment, the multi-channel adaptive communication controller is based on the STM32H743Z platform.

[0052] Figure 1 Schematic diagram of a user interaction module in an embodiment of the present invention.

[0053] like Figure 1 As shown, the user interaction module is used to realize the interaction between the user and the communication controller. The user sets the communication controller based on the user interaction module and monitors the working status of the communication controller in real time.

[0054] Specifically, the user interaction module is constructed in a micro-server manner, including a front-end and a back-end.

[0055] The front end is presented in the form of a panel and HTML web page. The front end has two functions: one is to receive and parse the data sent by the back end, and present the parsed results (including the current configuration and working status of the communication controller) to the user in a graphical form; the other is to provide the user with a configuration interface for the communication controller. After the user completes the configuration, the user configuration is converted into data in a specific format and sent to the back end. The user can access the web page through the panel or the network port to view the status of the communication controller and configure the communication controller.

[0056] The backend receives the data encapsulated in SLIP frames from the frontend through the serial port and parses it. The backend has three functions: first, establish a connection with the frontend and send the acquired working status of the communication controller to the frontend for display to the user; second, receive the data sent by the frontend and parse it. If the data type is the communication controller configuration, the backend configures the communication controller parameters according to the parsed data; third, interact with each module and encapsulate the working status obtained from each module into a data format that can be parsed by the frontend. The frontend and the backend customize the interaction protocol to ensure accurate transmission and processing of information.

[0057] The topology perception module is used to perceive the topology of the network where the communication controller is located in real time. When the communication controller is just started, the topology perception module will detect the topology of the network at the first time and pass the topology to the user interaction module; when the topology of the network changes, the topology perception module will send the changed topology perceived in real time to the user interaction module, subnet division module and routing generation module.

[0058] Specifically, the topology perception module includes a detection packet sending and receiving submodule and a topology analysis submodule.

[0059] The detection packet sending and receiving submodule is used to detect the device directly connected to the communication controller, other devices connected to the directly connected device, other communication controllers directly connected to the current communication controller, and the connection mode between the above devices and the communication controller.

[0060] To be more specific, the detection packet sending and receiving submodule is based on the LWIP protocol stack, and sends detection packets based on ARP and IP protocols on wired channels and wireless channels at the same time. It first locates the network node directly connected to the communication controller, and then continues to send detection packets to detect other nodes connected to the directly connected network node until there are no subsequent nodes or a new communication controller is encountered. The connection information between the communication controller and the directly connected network node, and between the directly connected network node and other nodes is stored in the memory in a list data structure.

[0061] The topology analysis submodule has two functions: first, based on the data received by the detection packet sending and receiving submodule, it determines which devices are directly connected to the current communication controller, which devices the devices directly connected to the communication controller are connected to, and whether these devices are connected by wire or wirelessly; second, based on the results analyzed by the detection packet sending and receiving submodule, a topology map is constructed, and the results in the topology map are sent to the user interaction module, the routing division module, and the subnet division module.

[0062] Figure 2 is an example diagram of a network structure in an embodiment of the present invention; Figure 3 is a schematic diagram of the network topology in an embodiment of the present invention. Figure 2 In the network shown in Figure 1, the topology analysis submodule can generate Figure 3 The topology diagram shown.

[0063] In this embodiment, after reading the connection information in the list, the topology analysis submodule generates a directed acyclic graph structure according to the Kahn algorithm, and sends the directed acyclic graph structure to the module requiring the network topology.

[0064] The subnet division module determines the subnet division method according to the user configuration. The subnet division methods include manual subnet division by the user and automatic subnet division by the communication controller. If the communication controller automatically divides the subnet, the subnet division module divides the subnet according to the topological structure of the network obtained by the topology perception module.

[0065] Specifically, the subnet division module is built based on the LWIP protocol stack. The subnet division module implements the subnet division function including the following steps:

[0066] Step S1, reading the user configuration, and determining whether the user requires manual subnet division or automatic subnet division by the communication controller.

[0067] Step S2: If the user requires manual subnet division, the subnet division module generates a VLAN number according to the user configuration.

[0068] Step S3, if the user requires the communication controller to automatically divide the subnet, the subnet division module reads the topology map generated by the topology analysis submodule, analyzes the current network topology (backbone network, star network, ring network, etc.), determines the terminal set that can be divided into the same subnet according to the current network topology, and then assigns a unique VLAN number to the divided subnet. The communication controller then transmits the VLAN number to the terminal in the same subnet, and the data exchanged between the terminal and the communication controller will be encapsulated into the link layer frame carrying the VLAN number. For example, if the current network topology is a mixed type, the devices that can form a cluster are divided into a subnet, and a VLAN is assigned to the subnet.

[0069] Step S4, sending the divided subnet information to the user interaction module.

[0070] The channel sensing module is used to monitor the communication quality of the channel currently used by the network in real time. When the communication quality drops below a specific threshold, the channel sensing module detects the communication quality of each channel in the network, selects the channel with the best communication quality, and notifies other devices in the network to switch communication channels. The modification of the channel is transparent to the user. Under normal circumstances, the user will not feel the channel switching when using it.

[0071] Specifically, the channel sensing module includes a channel detection submodule and a channel selection submodule.

[0072] The channel detection submodule sends a handshake packet to the terminal through the network cable or channel device based on a preset time interval. After the terminal receives the handshake packet, it returns a handshake response packet. The channel detection submodule counts the packet loss rate based on this to detect the communication quality of the current channel in real time. If the packet loss rate between the communication controller and a terminal is higher than the preset threshold, it means that the communication quality of the terminal is poor. The channel detection submodule will pass the message that the packet loss rate between the communication controller and a terminal is higher than the preset threshold to the channel selection submodule.

[0073] The channel selection submodule is used to reselect the communication channel between the communication controller and a specific terminal. After receiving a message that the packet loss rate is higher than a preset threshold, the channel selection submodule sends a channel detection frame to the terminal in each frequency band of the wired network and the wireless network. According to the number of responses from each terminal to the channel detection frame, the channel with the lowest packet loss rate, that is, the channel with the best communication quality, is selected as the new channel for communication with the terminal, and the channel switching information is sent to the topology perception module, and the data transmission process with the terminal is restarted with the new channel.

[0074] The routing generation module determines the adaptive routing algorithm through user configuration and the current network topology. The available routing strategies include manually configured routing table entries, RIP routing algorithm and OSPF routing algorithm.

[0075] For example, when the number of nodes (subnets) in the network topology exceeds 16, the controller automatically selects the OSPF routing algorithm; when the number of nodes (subnets) in the network topology is less than or equal to 16, the controller automatically selects the RIP routing algorithm. After determining the routing algorithm, the routing generation module will use the selected routing algorithm to generate routing table entries according to the obtained network topology type.

[0076] Specifically, the route generation module reads the user configuration and determines the route generation mode. The route generation modes include manual route generation and automatic route generation by the communication controller. If the route is manually generated, the communication controller generates a routing table according to the route entries filled in by the user; if the route is automatically generated by the communication controller, the route generation module reads the topology structure of the network obtained by the topology perception module, and selects an adaptive routing algorithm (such as RTP, OSPF, etc.) according to the topology structure to generate a routing table. When the topology structure of the network changes, the topology perception module sends the changed topology structure to the route generation module as soon as possible. After receiving the changed topology structure, the route generation module generates a new route entry. When the topology structure of the network changes significantly, the route generation module reselects a suitable routing algorithm according to the changed topology structure and generates a new route entry. When the communication controller switches the channel due to poor communication quality, the route generation module updates the route entries in the routing table according to the new topology structure after switching the channel. In this embodiment, the route generation module includes a routing algorithm selection submodule and a route generation submodule.

[0077] The routing algorithm selection submodule determines the generation method of routing table entries according to the user configuration. If the user chooses to manually generate routing table entries, the routing generation submodule generates them according to the user input; if the user chooses to automatically generate routing table entries by the controller, the routing algorithm selection submodule selects an appropriate routing algorithm according to the current network topology.

[0078] The route generation submodule generates corresponding route table entries according to the route algorithm selected by the route selection module. When automatically generating route table entries, the route generation module first generates some route table entries according to the topology structure generated by the topology perception module. Then, the communication controller sends query messages to adjacent communication controllers to generate route table entries for accessing other networks. When manually generating route table entries, the route generation module generates route table entries according to user input. After determining the routing algorithm, the route generation submodule uses the selected routing algorithm and combines the acquired topology type to generate route table entries.

[0079] The data forwarding module is used to implement the routing forwarding function. When the communication controller receives the message sent from each port, it will query the routing table according to the destination address in the message and forward the message according to the next hop address in the routing table entry.

[0080] Specifically, the data forwarding module is built based on the LWIP protocol stack, and the working process includes the following steps:

[0081] Step M1: After receiving the message transmitted from the terminal to the communication controller, the data forwarding module parses the message according to the LWIP protocol stack to obtain the source address, destination address and next hop address in the message.

[0082] Step M2, retrieve the corresponding routing table entry in the memory according to the destination address in the message. If the routing table entry corresponding to the destination address is found, add the next hop address in the routing table entry to the data packet to be forwarded, and forward the data packet from the port corresponding to the routing table entry.

[0083] Step M3, if no routing table entry corresponding to the destination address is found, the communication controller sends a query message to the adjacent communication controller to query whether the adjacent communication controller has a routing table entry corresponding to the destination address of the message. If so, the routing table entry is sent to the current communication controller, and the routing generation module is responsible for updating the routing table entry; if there is no corresponding routing table entry, the data forwarding module discards the data packet and sends a message to the source address to notify the source address that data forwarding has failed.

[0084] The working status monitoring module is used to monitor the working status of the communication controller. The monitoring scope includes the traffic currently forwarded by the communication controller, the number of subnets divided by the communication controller, the number of packet losses currently generated by the communication controller, whether the network is in a congested state, and the channel on which the communication controller is currently working, etc. This allows users to obtain the working status of the communication controller at any time.

[0085] Specifically, the working status detection module includes a status detection module and an abnormal response module.

[0086] The state detection module periodically reads the variables representing the state of the communication controller (such as packet loss rate, routing table items, etc.) in each module through a preset timing mechanism to obtain the state of the communication controller.

[0087] The exception response module responds to the controller exception in real time by setting a callback function.

[0088] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.

[0089] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.

Claims

1. A multi-channel adaptive communication controller based on STM32 platform, characterized in that: include: User interaction module, topology perception module, subnet division module, channel perception module, route generation module, data forwarding module and working status monitoring module; The user interaction module is used to realize the interaction between the user and the communication controller; The topology perception module is used to perceive the topology structure of the network where the communication controller is located in real time. When the communication controller is started, the topology perception module detects the topology structure of the network and transmits the topology structure to the user interaction module; when the topology structure of the network changes, the topology perception module sends the changed topology structure perceived in real time to the user interaction module, the subnet division module and the route generation module; The subnet division module determines the subnet division method according to the user configuration, and the subnet division method includes manual subnet division by the user and automatic subnet division by the communication controller. If the communication controller automatically divides the subnet, the subnet division module divides the subnet according to the topological structure of the network obtained by the topology perception module; The channel sensing module is used to monitor the communication quality of the channel currently used by the network in real time. When the communication quality drops below a specific threshold, the channel sensing module detects the communication quality of each channel in the network, selects the channel with the best communication quality, and notifies other devices in the network to switch communication channels; The routing generation module determines the adaptive routing algorithm through user configuration and the topological structure of the current network. The available routing strategies include manually configured routing table items, RIP routing algorithm and OSPF routing algorithm. The data forwarding module is used to implement the routing forwarding function. When the communication controller receives a message sent from each port, it will query the routing table according to the destination address in the message and forward the message according to the next hop address in the routing table entry; The working status monitoring module is used to monitor the working status of the communication controller.

2. A multi-channel adaptive communication controller based on the STM32 platform according to claim 1, characterized in that: The multi-channel adaptive communication controller is based on the STM32H743Z platform.

3. A multi-channel adaptive communication controller based on the STM32 platform according to claim 1, characterized in that: The user interaction module is constructed in the form of a micro server, including a front end and a back end; The front end is presented in the form of a panel and an HTML web page; The back end receives the data encapsulated into SLIP frames by the front end through the serial port and parses it. The front end and the back end define a customized interaction protocol to ensure accurate transmission and processing of information.

4. A multi-channel adaptive communication controller based on the STM32 platform according to claim 1, characterized in that: The topology perception module includes a detection packet sending and receiving submodule and a topology analysis submodule; The detection packet sending and receiving submodule is based on the LWIP protocol stack, and simultaneously sends detection packets based on the ARP and IP protocols in the wired channel and the wireless channel, first locates the network node directly connected to the communication controller, and then continues to send detection packets to detect other nodes connected to the directly connected network node until there are no subsequent nodes or a new communication controller is encountered, and the connection information between the communication controller and the directly connected network node, and between the directly connected network node and other nodes is stored in the memory in a list data structure; After reading the connection information in the list, the topology analysis submodule generates a directed acyclic graph structure according to the Kahn algorithm, and sends the directed acyclic graph structure to the module requiring the network topology.

5. The multi-channel adaptive communication controller based on the STM32 platform according to claim 1 is characterized in that: The subnet division module is constructed based on the LWIP protocol stack, and the subnet division module implements the subnet division function including the following steps: Step S1, read the user configuration, and determine whether the user requires manual subnet division or the communication controller automatically divides the subnet; Step S2, if the user requires manual subnet division, the subnet division module generates a VLAN number according to the user configuration; Step S3, if the user requires the communication controller to automatically divide the subnet, the subnet division module reads the topology map generated by the topology analysis submodule, determines the current network topology structure, determines the terminal set that can be divided into the same subnet according to the current network topology structure, and then allocates a unique VLAN number to the divided subnet. The communication controller then transmits the VLAN number to the terminal in the same subnet, and the data exchanged between the terminal and the communication controller will be encapsulated into the link layer frame carrying the VLAN number; Step S4, sending the divided subnet information to the user interaction module.

6. The multi-channel adaptive communication controller based on the STM32 platform according to claim 1 is characterized in that: The channel sensing module includes a channel detection submodule and a channel selection submodule; The channel detection submodule sends a handshake packet to the terminal through a network cable or a channel device based on a preset time interval. The terminal returns a handshake response packet after receiving the handshake packet. The channel detection submodule counts the packet loss rate to detect the communication quality of the current channel in real time. If the packet loss rate of the communication controller and a certain terminal is higher than a preset threshold, the channel detection submodule transmits a message that the packet loss rate of the communication controller and a certain terminal is higher than the preset threshold to the channel selection submodule. The channel selection submodule is used to reselect the communication channel between the communication controller and the specific terminal. After receiving the message, the channel selection submodule sends a channel detection frame to the terminal in each frequency band of the wired network and the wireless network, and selects the channel with the lowest packet loss rate, that is, the channel with the best communication quality, as the new channel for communicating with the terminal according to the number of responses of each terminal to the channel detection frame, and sends the channel switching information to the topology perception module, and restarts the data transmission process with the terminal with the new channel.

7. A multi-channel adaptive communication controller based on the STM32 platform according to claim 1, characterized in that: The route generation module reads the user configuration and determines the route generation method, which includes manual route generation and automatic route generation by the communication controller. If the route is manually generated, the communication controller generates a routing table according to the route entries filled in by the user; if the route is automatically generated by the communication controller, the route generation module reads the topology structure of the network obtained by the topology perception module, and selects an adaptive routing algorithm according to the topology structure to generate a routing table; when the topology structure of the network changes, the topology perception module sends the changed topology structure to the route generation module as soon as possible, and the route generation module generates new route entries after receiving the changed topology structure; when the topology structure of the network changes significantly, the route generation module reselects a suitable routing algorithm according to the changed topology structure and generates new route entries; when the communication controller switches channels due to poor communication quality, the route generation module updates the route entries in the routing table according to the new topology structure after switching channels.

8. The multi-channel adaptive communication controller based on the STM32 platform according to claim 7, characterized in that: The routing generation module includes a routing algorithm selection submodule and a routing generation submodule; The routing algorithm selection submodule determines the generation method of the routing table items according to the user configuration. If the user selects to manually generate the routing table items, the routing generation submodule generates them according to the user input; if the user selects the communication controller to automatically generate the routing table items, the routing algorithm selection submodule selects an adaptive routing algorithm according to the topological structure of the current network; The routing generation submodule generates corresponding routing table entries according to the routing algorithm selected by the routing selection module. When automatically generating routing table entries, the routing generation module first generates part of the routing table entries according to the topology structure generated by the topology perception module. Subsequently, the communication controller sends a query message to an adjacent communication controller to generate routing table entries for accessing other networks. When manually generating routing table entries, the routing generation module generates routing table entries according to user input, and after determining the routing algorithm, the routing generation submodule applies the routing algorithm and combines the acquired topology type to generate routing table entries.

9. The multi-channel adaptive communication controller based on the STM32 platform according to claim 1, characterized in that: The data forwarding module is built based on the LWIP protocol stack, and the working process includes the following steps: Step M1, after receiving the message transmitted by the terminal to the communication controller, the data forwarding module parses the message according to the LWIP protocol stack to obtain the source address, destination address and next hop address in the message; Step M2, searching the corresponding routing table entry in the memory according to the destination address in the message, if the routing table entry corresponding to the destination address is found, then adding the next hop address in the routing table entry to the data packet to be forwarded, and forwarding the data packet from the port corresponding to the routing table entry; Step M3, if no routing table entry corresponding to the destination address is found, the communication controller sends a query message to the adjacent communication controller to query whether the adjacent communication controller has a routing table entry corresponding to the destination address of the message. If so, the routing table entry is sent to the current communication controller, and the routing generation module is responsible for updating the routing table entry; if there is no corresponding routing table entry, the data forwarding module discards the data packet and sends a message to the source address to notify the source address that data forwarding has failed.

10. The multi-channel adaptive communication controller based on the STM32 platform according to claim 1, characterized in that: The working status detection module includes a status detection module and an abnormal response module; The state detection module periodically reads the variables representing the state of the communication controller in each module through a preset timing mechanism to obtain the state of the communication controller; The abnormal response module responds to the abnormality of the communication controller in real time by setting a callback function.

Citation Information

Patent Citations

  • Adaptive Dynamic Subnet Partitioning Method in Wireless Sensor Networks

    CN104883691B

  • Reliable transmission method based on SDN

    CN107347021A

  • Computer network intelligent networking and optimization system and method

    CN108566305A

  • High-reliability and high-security wireless network topology control system

    CN110035468A

  • Wireless channel equipment sensing and topology synchronization method in large-scale networking environment

    CN115499891A

Cited By

  • Global visual presentation method and device for routing data

    CN120811906A

  • A method and apparatus for globally visualizing routing data

    CN120811906B