A self-checking router network communication system
Patent Information
- Application Number
- CN202511354507.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2045-09-22
AI Technical Summary
[0008]本发明的目的在于提供一种自检式路由器网络通信系统,以解决上述背景技术中提出部分自检工具只能检测网络接口卡是否正常工作,而对于路由器的处理器性能、内存使用情况、操作系统的稳定性以及各种路由协议的运行状态等,却无法进行有效的检测,此外,大多数自检技术需要手动触发,无法实时监测路由器的运行状态,并且,自检程序也会受到复杂的网络环境和不断增长的数据流量的影响,自检程序故障使得网络通信检查显露出效率低下、准确性不足等问题
通过实时的自检功能,能够及时发现硬件故障和网络连接问题,并迅速采取相应的修复措施,有效减少网络中断的时间,在硬件设备出现故障的初期,自检程序就能检测到异常,如网卡出现轻微的数据传输错误时,系统会立即发出警报,并尝试进行自我修复,如重新初始化网卡驱动程序或者切换到备用网卡,确保网络通信的连续性。
Smart Images

Figure CN121151262B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of router network communication technology, specifically to a self-testing router network communication system. Background Technology
[0002] Routers are widely used in various scenarios such as homes, businesses, and data centers. They provide functions such as NAT, DHCP, and firewalls, and support wireless access and wireless network expansion. Users need to choose based on factors such as network requirements, performance, security, and scalability. Common problems when using routers include connection issues, weak signals, and frequent disconnections. A stable router network communication system can maintain stable data transmission.
[0003] For example, patent CN118764898B discloses a wireless router network communication quality assurance system, including: a shielding judgment mechanism, used to determine the signal shielding level of the wireless router based on the representative depth value, which is the depth of field with the highest frequency among the various depths of field corresponding to each pixel that matches the color imaging characteristics of the metal material in the content enhancement image, and the distribution level of surface impurities; and a signal adjustment mechanism, used to adjust the antenna signal transmission strength of the wireless router based on the determined signal shielding level of the wireless router. The system can provide key reference information for adjusting the signal strength of the wireless router, thus ensuring the network communication quality of the wireless router.
[0004] For example, patent CN117793857B discloses a wireless router access method and system. The method includes the following steps: acquiring router signal data and router antenna data and digitizing the signal propagation environment to obtain a digital model of the router environment; performing dynamic antenna bias analysis on the router signal data to obtain an antenna bias strategy; acquiring digital signal processing data and prioritizing signal processing to obtain a signal processing strategy, which is then transmitted to a baseband processor; acquiring historical broadband resource allocation data and performing resource allocation coupling simulation to obtain optimal resource allocation data; and optimizing the antenna bias strategy based on the optimal resource allocation data and the antenna bias strategy to obtain an optimized antenna bias strategy, which is then transmitted to a controller to meet the network communication needs of different user scenarios and improve user experience and network performance.
[0005] For example, patent CN118714036A discloses a self-testing method and system for OpenWRT routers, ONUs, and gateways. The method includes: Step S1, the smart terminal starts the self-testing module via the ubus command; Step S2, the self-testing module automatically performs network self-tests on the smart terminal for at least the following network items: network card wiring, negotiation speed, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflicts, loops, multiple DHCP server conflicts, IP address conflicts, routing configuration, next-hop connectivity, DNS configuration, number of IP sessions, DHCP capacity, and network traffic; Step S3, the smart terminal calls the self-testing module via the ubus command to obtain the self-test results of each network item and generates a self-testing report based on the results; Step S4, the smart terminal encrypts the self-testing report and sends it to the server; Step S5, the server decrypts the encrypted report to obtain and displays the self-testing report.
[0006] To address faults in router network communication systems, several self-testing technologies have emerged. However, some self-testing tools can only detect whether the network interface card is functioning correctly. They cannot effectively detect the router's processor performance, memory usage, operating system stability, or the operational status of various routing protocols. This means that even after a self-test, undetected potential faults may still exist. Once these faults materialize, they can severely impact network communication. Furthermore, most self-testing technologies require manual triggering and cannot monitor the router's operational status in real time. Faults can occur at any time during network communication, and manually triggered self-tests cannot detect them promptly. This leads to delayed problem resolution, prolonged network outages, and inconvenience for users. Moreover, self-testing programs are also affected by complex network environments and ever-increasing data traffic. Faults in self-testing programs reveal inefficiencies and inaccuracies in network communication checks.
[0007] To address the aforementioned issues, there is an urgent need for innovative design based on the existing router network communication system. Summary of the Invention
[0008] The purpose of this invention is to provide a self-testing router network communication system to solve the problems mentioned in the background art. Some self-testing tools can only detect whether the network interface card is working properly, but cannot effectively detect the router's processor performance, memory usage, operating system stability, and the running status of various routing protocols. In addition, most self-testing technologies require manual triggering and cannot monitor the router's operating status in real time. Furthermore, the self-testing program is also affected by the complex network environment and the ever-increasing data traffic. Failure of the self-testing program makes network communication checks inefficient and inaccurate.
[0009] To achieve the above objectives, the present invention provides the following technical solution: a self-testing router network communication system, comprising a hardware module and a software module; the hardware module includes: a central processing unit for executing system instructions and data processing; a storage unit for storing temporary data, basic startup programs, and key configuration files; a network interface for connecting to an external network; LEDs for visually displaying the router's operating status; and a reset button for restoring the system to factory settings in case of configuration errors, forgotten passwords, or system crashes, wherein the storage unit is connected to the CPU via an SPI bus to enable data reading and writing; the software module includes: a routing protocol module for dynamically learning and maintaining routing tables and calculating the optimal forwarding path, used to implement network... The system includes a communication protocol stack for data encapsulation, decapsulation, and transmission; a network management module for system configuration, monitoring, and management; and a self-testing program for comprehensive hardware and software testing. The self-testing program checks for hardware faults and data transmission status in the software. Its self-test items include network card testing, power supply testing, network connectivity testing, and routing table accuracy testing. The program features automation and parallel processing technologies, breaking down tasks into multiple sub-tasks and assigning them to different processing units for simultaneous execution without interference. Continuous monitoring and optimization mechanisms are incorporated to enhance self-testing capabilities, enabling proactive risk prediction and prevention of communication failures.
[0010] Preferably, the network card detection uses a detection program to check its hardware status, including whether the chip is working properly and whether the interface shows signs of damage, and tests its data transmission rate and stability; if the network card's data transmission rate is found to be significantly lower than normal or the packet loss rate is too high, it is determined that the network card is faulty, and the fault includes problems with the network card driver or damage to the network card hardware; factors that prevent the network card from being identified include hardware failure, driver problems, kernel module not being loaded, or BIOS settings errors.
[0011] Preferably, the power supply detection includes monitoring whether the output voltage and current of the power supply are stable within the normal range. Voltage and current detection instruments are used for real-time monitoring. If abnormal fluctuations in voltage or current occur, exceeding ±5% of the normal range, it is determined that there is a potential fault in the power supply. Potential faults include damaged power cord, poor contact of connectors, aging of the power adapter, and damage to internal circuit components.
[0012] Preferably, the network connectivity detection specifically includes: If you send an ICMP echo request packet to a preset target IP address using the ping command and receive a response packet from the target device in a timely manner, it indicates that the network is connected normally at the P layer. Execute the ping command to test the connectivity between the router and a specific IP address or domain name.
[0013] Use the traceroute command to trace all router paths a data packet takes from source to destination. By analyzing whether each node in the path responds normally, you can determine whether there are intermediate node failures or routing errors in the network. If a node is found to be unresponsive for a long time or an abnormal route jump occurs during the tracing process, you need to further investigate whether there are problems with the node and related routing configurations.
[0014] Preferably, the accuracy of the routing table is checked by comparing it with network topology information. Network topology information records the physical and logical connections of all devices in the network, while the routing table stores the target network, next hop, and outgoing interface mapping relationships that the router relies on when forwarding data packets. Specifically, it includes: The system obtains the current network topology, including the connection relationships of each network node and information such as IP address allocation.
[0015] The routing entries in the routing table are compared one by one with the network topology to check for erroneous routing information, such as routes pointing to unreachable networks or routes with incorrect next-hop addresses.
[0016] Verify that the routing table is updated in a timely and accurate manner. When the network topology changes, the routing table should be updated within a specified time to ensure that data packets are forwarded along the correct path.
[0017] Preferably, the self-test program is triggered in two ways: timed self-test and event-triggered self-test, specifically including: The scheduled self-test is a proactive and periodic detection mode, which is set to start automatically at regular intervals based on user needs and the actual network conditions. Event-triggered self-check is a passive and immediate detection mode that automatically starts when a specific event occurs in the system. Specific events include system restart, changes in network interface status, and sudden abnormal increases or decreases in network traffic.
[0018] The self-test procedure follows a logic of hardware testing first, then software testing. While ensuring the hardware modules are functioning normally, it performs software module operation checks, specifically including: Perform basic hardware tests; power supply, memory, and other hardware are the foundation for the normal operation of the system.
[0019] Network connectivity is tested using methods such as local loop detection, gateway connectivity detection, and external network connectivity detection to determine whether the network can communicate normally.
[0020] The accuracy of the routing table is checked, including local network routes, default routes, and static routes. The destination network address, subnet mask, next-hop address, and outgoing interface of each route entry in the routing table are checked to ensure they are correct. For networks using dynamic routing protocols, the accuracy of the routing table is checked to ensure it can dynamically update route entries based on changes in the network topology. The correctness of the routing table directly affects the forwarding path of network data packets.
[0021] The self-test program records the self-test results in a detailed log file. The log file records the time of each self-test, the self-test items, the test results, and any possible error information. For each test item, it clearly records whether it passed or failed. If the test fails, it records the error code and error description in detail, facilitating subsequent troubleshooting and analysis by the administrator. The system's self-test function can quickly and accurately locate the fault point. When a network failure occurs, the administrator only needs to check the self-test report and logs to quickly determine whether it is a hardware failure, a network connection problem, or a routing error. If the log shows that the packet loss rate of a certain network interface is too high, the administrator can directly check and repair that network interface without having to check each component and configuration one by one like in traditional systems, saving a significant amount of time and effort.
[0022] Preferably, the automation and parallel processing technology includes two parallel execution functions, recv and send. send is used to send data, and recv is used to receive data. recv and send are based on multi-threading and asynchronous operation technology, specifically including: Multithreading technology creates different threads to handle recv and send operations respectively, and multiple threads execute concurrently at the same time, achieving parallel processing of data reception and transmission.
[0023] Asynchronous operation technology allows the recv and send functions to not block other operations in the program when they are executed. After calling the asynchronous recv function, it returns immediately, and the program will not wait for the data to be received before continuing to execute other code.
[0024] Furthermore, in addition to parallel processing, the self-checking program adds a self-verification program (check) to verify the data after processing is complete.
[0025] Automation and parallel processing technologies can automatically track progress, count the number of completed subtasks in real time, calculate the progress percentage, and automatically trigger alarms for subtasks that have not been completed for a long time, notifying manual intervention for troubleshooting.
[0026] Preferably, the continuous monitoring and optimization mechanism designs monitoring points around three dimensions: the self-inspection object, the self-inspection process, and the self-inspection result, specifically including: Self-test object monitoring involves embedding monitoring code at key nodes of the self-test program to collect real-time data and analyze program runtime logs in real time using the ELK tool.
[0027] The self-test process is monitored by tracking the task lifecycle through the monitoring plugin of the scheduled task framework. Combined with the top and nmon monitoring tools in the system, it collects the resource usage data of the self-test program and records the execution result, triggering condition, and associated data of each self-test rule.
[0028] Self-inspection result monitoring involves aggregating and analyzing self-inspection results by anomaly type, module, and other dimensions through a database or data warehouse. Abnormal results are then linked to the work order system to track processing progress, set up result review entry points, and collect manual correction opinions on self-inspection results.
[0029] Preferably, the communication protocol stack includes an application layer, a transport layer, a network layer, a data link layer, and a physical layer. The router mainly operates at the network layer, and its data transmission process specifically includes: Data is received through the network interface, identified and classified according to the protocol type of the data packets. For TCP protocol data, the TCP header information is checked, including the source port, destination port, sequence number, acknowledgment number, etc., to ensure the integrity and correctness of the data packets. The data is then passed to the TCP protocol processing module for processing, which includes establishing a TCP connection, ensuring reliable data transmission, handling data packet retransmission, and acknowledgment.
[0030] For UDP protocol data, check the UDP header information, including the source port, destination port, and data length, and then directly pass the data to the corresponding application.
[0031] When forwarding data, the next-hop address of the data packet is determined based on the routing table information. Among multiple routes, the best path is selected according to the routing algorithm, and the data packet is sent to the network interface corresponding to the next-hop address and then sent out.
[0032] Preferably, the routing algorithm used for data forwarding considers factors including network link bandwidth, latency, load, and node reliability. The system assigns a metric to each network link, which comprehensively reflects various performance indicators of the link. Links with higher bandwidth, lower latency, and lighter load are assigned lower metric values, indicating that the link is a better choice. The system periodically collects performance information of each network link, updates the link metric values in real time, searches for available route entries in the routing table based on the destination address, calculates the sum of the link metric values corresponding to each route entry, and selects the route with the smallest sum of metric values as the best path.
[0033] Compared with the prior art, the beneficial effects of the present invention are: Through real-time self-testing, hardware faults and network connectivity problems can be detected in a timely manner, and corresponding repair measures can be taken quickly, effectively reducing network interruption time. In the early stages of hardware device failure, the self-testing program can detect abnormalities. For example, if the network card has a minor data transmission error, the system will immediately issue an alarm and attempt to self-repair, such as re-initializing the network card driver or switching to a backup network card, to ensure the continuity of network communication.
[0034] In terms of troubleshooting efficiency, the system's self-test function can quickly and accurately locate the fault point. When a network failure occurs, the administrator only needs to check the self-test report and logs to quickly determine whether it is a hardware failure, network connection problem, or routing error. If the log shows that the packet loss rate of a certain network interface is too high, the administrator can directly check and repair that network interface without having to check each component and configuration one by one like in traditional systems, saving a lot of time and effort and improving the efficiency of troubleshooting and repair.
[0035] Parallel processing technology saves a lot of time by decomposing a task into multiple subtasks and assigning them to different processing units for simultaneous execution. In router network communication systems, the parallel processing of recv and send means that data reception and transmission no longer wait for each other, and their execution times overlap, forming a powerful multi-verification mechanism. When recv and send work in parallel, they independently perform data reception and transmission operations, which means that during data transmission, data flows in both directions simultaneously, forming a preliminary cross-verification between them.
[0036] Based on continuous monitoring and optimization mechanisms, the self-inspection process has transformed from passively discovering problems to proactively preventing risks and iterating and upgrading itself, with self-inspection capabilities improving in tandem with the complexity of the program's business processes. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of the router network communication system of the present invention. Detailed Implementation
[0038] 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 some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] Example 1, please refer to Figure 1This invention provides the following technical solution: a self-testing router network communication system, comprising a hardware module and a software module; the hardware module includes: a central processing unit for executing system instructions and data processing; a storage unit for storing temporary data, basic startup programs, and key configuration files; a network interface for connecting to an external network; LEDs for visually displaying the router's operating status; and a reset button for restoring the router to factory settings in case of configuration errors, forgotten passwords, or system crashes. The storage unit is connected to the CPU via an SPI bus for data reading and writing. The software module includes: a routing protocol module for dynamically learning and maintaining routing tables and calculating the optimal forwarding path; and a module for implementing network data... The system includes a communication protocol stack for encapsulation, decapsulation, and transmission; a network management module for configuring, monitoring, and managing the system; and a self-test program for comprehensively testing the system's hardware and software. The self-test program checks for hardware faults and data transmission status in the software. Its self-test items include network card testing, power supply testing, network connectivity testing, and routing table accuracy testing. The program features automation and parallel processing technology, breaking down tasks into multiple sub-tasks and assigning them to different processing units for simultaneous execution without interference. Continuous monitoring and optimization mechanisms are incorporated to enhance self-testing capabilities, enabling proactive risk prediction and prevention of communication failures.
[0040] It should be noted that the hardware module of this application is centered on a high-performance central processing unit (CPU), which acts as the brain of the system, responsible for executing various system instructions, performing data processing and calculations, and playing a crucial role in the overall performance of the system. For example, when processing a large number of network data packets, the fast CPU can quickly complete operations such as data parsing and forwarding decisions, ensuring the efficiency of network communication. The storage unit includes various types, such as random access memory (RAM), used to store temporary data during system operation, such as data packets being processed and temporary update information of the routing table. Its fast read and write speed allows the system to quickly access and process data. Read-only memory (ROM) stores the system's basic startup program and important initialization code, ensuring that the system can be correctly loaded and run at startup. Flash memory is used to store the system's operating system image and some key configuration files. It can retain data even when the system is powered off, and it is erasable, rewritable, and programmable, facilitating system upgrades and maintenance.
[0041] Network interfaces serve as bridges connecting the system to external networks. They include various types such as Ethernet interfaces and wireless interfaces to adapt to different network environments and connection requirements. Ethernet interfaces can be used to connect to wired networks, providing stable and high-speed data transmission; wireless interfaces facilitate users' access to the system via wireless networks, enabling mobile office work or device connectivity. These hardware components are interconnected through a high-speed internal bus, forming an organic whole that ensures data can be transmitted quickly and accurately between the various components.
[0042] In terms of software modules, the self-test program is one of the core modules. It is responsible for performing a comprehensive self-test of the system's hardware and software, and promptly identifying potential faults and problems. The communication protocol stack contains various network communication protocols, such as TCP / IP and UDP, and is responsible for encapsulating, decapsulating, and transmitting network data to ensure that the system can communicate normally with other network devices. The network management module is used for configuring, monitoring, and managing the system. Administrators can use this module to set various system parameters, view the system's operating status, and optimize and adjust the network.
[0043] Network card testing checks the hardware status of a network card through a testing program, including whether the chip is working properly and whether there are signs of damage to the interface, and tests its data transmission rate and stability. If the network card's data transmission rate is found to be significantly lower than normal or the packet loss rate is too high, it is determined that the network card is faulty. Faults include problems with the network card driver, damage to the network card hardware, and factors that prevent the network card from being identified, including hardware failure, driver problems, kernel modules not being loaded, or incorrect BIOS settings.
[0044] Power supply testing includes monitoring whether the output voltage and current of the power supply are stable within the normal range. Voltage and current testing instruments are used for real-time monitoring. If abnormal fluctuations in voltage or current occur, exceeding ±5% of the normal range, it is determined that there is a potential fault in the power supply. Potential faults include damaged power cords, poor contact at connectors, aging power adapters, and damage to internal circuit components.
[0045] Network connectivity testing specifically includes: using the ping command to send ICMP echo request packets to a preset target IP address; if a response packet is received from the target device in a timely manner, it indicates that the network is connected normally at the P layer; executing the ping command to test the connectivity between the router and a specific IP address or domain name; using the traceroute command to trace all router paths that data packets take from source to destination; and analyzing whether each node in the path responds normally to determine whether there are intermediate node failures or routing errors in the network; if a node is found to be unresponsive for a long time or to exhibit abnormal route jumps during the tracing process, further investigation is needed to determine whether there are problems with the node and related routing configurations.
[0046] The accuracy of the routing table is checked by comparing it with network topology information. Network topology information records the physical and logical connections between all devices in the network. The routing table stores the target network, next hop, and outgoing interface mappings that routers rely on when forwarding data packets. Specifically, this involves: the system acquiring the current network topology, including the connection relationships of each network node and IP address allocations; comparing each routing entry in the routing table with the network topology to check for erroneous routing information, such as routes pointing to unreachable networks or routes with incorrect next-hop addresses; and verifying the timeliness and accuracy of routing table updates. When the network topology changes, the routing table should be updated accordingly within a specified time to ensure that data packets are forwarded along the correct path.
[0047] It should be noted that in the accuracy detection of the routing table in this application, if there have been recent additions or removals of devices or changes to links in the network, the topology information must be updated first; otherwise, normal routes will be misjudged as abnormal. The topology is synchronized periodically through a topology discovery tool. The routing table is based on logical topology for forwarding, and logical topology information is used first during comparison. For example, if the same physical link is divided into multiple VLANs, the comparison should be made according to the logical interface corresponding to the VLAN, not the physical port. In some scenarios, there may be temporary routes, such as test routes added manually during troubleshooting. These need to be marked and excluded before comparison to avoid misjudging them as redundant routes.
[0048] The self-test program can be triggered in two ways: timed self-test and event-triggered self-test. Specifically, timed self-test is a proactive and periodic detection mode that is set to start automatically at regular intervals based on user needs and the actual network conditions. Event-triggered self-test is a passive and immediate detection mode that is automatically started when a specific event occurs in the system. Specific events include system restart, changes in network interface status, and sudden abnormal increases or decreases in network traffic.
[0049] It should be noted that in the self-testing program of this application, the timed self-test can be set to start automatically at certain intervals (such as 1 hour, 4 hours, etc.) according to the user's needs and the actual situation of the network. For example, in some enterprise networks with high requirements for network stability, a comprehensive self-test can be set to be performed every hour to promptly detect potential problems and ensure the continuous and stable operation of the network. The event-triggered self-test will start automatically when a specific event occurs in the system, such as system restart, changes in network interface status (connection or disconnection), or a sudden abnormal increase or decrease in network traffic. When the system restarts, the self-testing program will start immediately to perform a comprehensive check on the system's hardware and software to ensure that the system can operate normally after the restart.
[0050] The self-test procedure follows a hardware-first, software-later logic. While ensuring the hardware modules are functioning correctly, it performs software module checks, specifically including: basic hardware checks (power supply, memory, etc., are fundamental for normal system operation); network connectivity checks (local loop detection, gateway connectivity detection, and external network connectivity detection to determine network communication capabilities); and routing table accuracy checks (local network routes, default routes, and static routes), verifying the correctness of parameters such as destination network address, subnet mask, next-hop address, and outgoing interface for each routing entry. For networks using dynamic routing protocols, it checks whether the routing table can dynamically update routing entries based on changes in network topology, as the correctness of the routing table directly affects the forwarding path of network data packets.
[0051] The self-test results of the self-test program are recorded in a detailed log file, which includes: the time of each self-test, the self-test items, the test results, and possible error information; for each test item, it is clearly recorded whether it passed or failed, and if it failed, the error code and error description are recorded in detail to facilitate the administrator's subsequent troubleshooting and analysis.
[0052] It is important to note that the error information recorded in the log file is the core content for troubleshooting and analysis. For items that fail the test, the error code and error description are recorded in detail. The error codes adopt a unified coding rule to facilitate maintenance personnel to quickly identify the error type. The error description details the specific circumstances of the error, such as unstable power supply output voltage, with the measured voltage being 11.8V (the standard voltage is 12V±5%). Through detailed error information, maintenance personnel can quickly locate the root cause of the problem and take effective measures to resolve it.
[0053] In practice, if the network card fails the test, the log file will record the network card model, error code (such as 0x001, indicating abnormal data transmission rate) and specific error description (such as the network card's current data transmission rate is only 10Mbps, far lower than the nominal 100Mbps). Administrators can quickly locate the problem based on these records and take corresponding solutions.
[0054] Automation and parallel processing technologies include two parallel execution functions, recv and send. send is used to send data, and recv is used to receive data. recv and send are based on multithreading and asynchronous operation technologies, specifically including: Multithreading technology creates different threads to handle recv and send operations respectively, and multiple threads execute concurrently at the same time, achieving parallel processing of data reception and transmission.
[0055] Asynchronous operation technology allows the recv and send functions to not block other operations in the program when they are executed. After calling the asynchronous recv function, it returns immediately, and the program will not wait for the data to be received before continuing to execute other code.
[0056] Furthermore, in addition to parallel processing, the self-checking program adds a self-verification program (check) to verify the data after processing is complete.
[0057] Automation and parallel processing technologies can automatically track progress, count the number of completed subtasks in real time, calculate the progress percentage, and automatically trigger alarms for subtasks that have not been completed for a long time, notifying manual intervention for troubleshooting.
[0058] In practical implementation, CPU-intensive tasks such as data encryption verification and algorithm correctness verification are performed using multiple processes and multi-core CPUs for parallel computing to avoid GIL lock limitations; for I / O-intensive tasks such as network interface testing and disk I / O detection, multi-threading is used to reduce I / O waiting time and improve resource utilization; for example, in the self-test of a home router, 2.4G Wi-Fi signal detection and 5G Wi-Fi signal detection are executed in parallel as two threads, simultaneously collecting indicators such as signal strength and connection speed.
[0059] The continuous monitoring and optimization mechanism is designed with monitoring points around three dimensions: the self-inspection object, the self-inspection process, and the self-inspection results. Specifically, it includes: Self-test object monitoring involves embedding monitoring code at key nodes of the self-test program to collect real-time data and analyze program runtime logs in real time using the ELK tool.
[0060] The self-test process is monitored by tracking the task lifecycle through the monitoring plugin of the scheduled task framework. Combined with the top and nmon monitoring tools in the system, it collects the resource usage data of the self-test program and records the execution result, triggering condition, and associated data of each self-test rule.
[0061] Self-inspection result monitoring involves aggregating and analyzing self-inspection results by anomaly type, module, and other dimensions through a database or data warehouse. Abnormal results are then linked to the work order system to track processing progress, set up result review entry points, and collect manual correction opinions on self-inspection results.
[0062] In practice, based on anomaly handling data from monitoring, some anomalies are automatically repaired: for example, if monitoring finds that a configuration file is missing and the historical handling solution is to restore from backup, an automatic recovery logic is added. After the self-check program finds an anomaly, it directly performs the recovery operation without manual intervention. For high-risk anomalies, such as database connection failures, the alarm push path is optimized. The alarm is first pushed to the operations and maintenance group. If there is no response within 10 minutes, it is automatically escalated to the technical lead and the monitoring data is reported to speed up the investigation.
[0063] The communication protocol stack includes the application layer, transport layer, network layer, data link layer, and physical layer. Routers primarily operate at the network layer, and their data transmission process specifically includes: receiving data through the network interface, identifying and classifying the data packet protocol type; for TCP protocol data, checking the TCP header information, including source port, destination port, sequence number, acknowledgment number, etc., to ensure the integrity and correctness of the data packet, and passing the data to the TCP protocol processing module for processing, including establishing a TCP connection, ensuring reliable data transmission, handling data packet retransmission, and acknowledgment; for UDP protocol data, checking the UDP header information, including source port, destination port, and data length, and directly passing the data to the corresponding application; when forwarding data, determining the next-hop address of the data packet based on the routing table information, selecting the best path among multiple routes according to the routing algorithm, and sending the data packet to the network interface corresponding to the next-hop address and sending it out.
[0064] When forwarding data, the routing algorithm considers factors such as network link bandwidth, latency, load, and node reliability. The system assigns a metric to each network link, reflecting various performance indicators. Links with higher bandwidth, lower latency, and lighter load are assigned lower metric values, indicating they are the optimal choice. The system periodically collects performance information from each network link, updates link metrics in real time, searches for available route entries in the routing table based on the destination address, calculates the sum of link metrics for each route entry, and selects the route with the smallest sum of metrics as the best path. The system's self-checking function can quickly and accurately locate fault points. When a network failure occurs, administrators only need to check the self-check report and logs to quickly determine whether it is a hardware failure, network connection problem, or routing error. If the logs show that the packet loss rate of a certain network interface is too high, the administrator can directly check and repair that network interface without having to check each component and configuration one by one like in traditional systems, saving a significant amount of time and effort.
[0065] In practice, if there are multiple paths to the target address in the network, one path has higher bandwidth but slightly higher latency, and another path has lower bandwidth but very low latency, the system will comprehensively consider factors such as bandwidth and latency, and calculate the metric value of each path using a specific algorithm. If the current network traffic is high and the bandwidth requirement is high, the system may choose the path with higher bandwidth. If real-time requirements are high, such as during video conferencing, the system may prioritize the path with lower latency to ensure timely data transmission and smooth video conferencing. Through this dynamic routing selection method, the system can adjust the routing in a timely manner according to changes in network conditions, select the best transmission path for data packets, and improve the efficiency and reliability of network communication.
[0066] Example 2: To better understand the above technical solution, the following will provide a detailed explanation of the specific implementation method using a practical example. In the highly digitalized era, the stability and reliability of router network communication systems are crucial as key hubs for information transmission. Self-testing programs serve as the first line of defense to ensure the normal operation of the system, enabling timely detection and resolution of potential problems. To adapt to complex network environments and ever-increasing data traffic, a self-testing router network communication system is proposed, comprising hardware and software modules, as detailed below: The hardware module includes: a central processing unit for executing system instructions and data processing; a storage unit for storing temporary data, basic startup programs, and key configuration files; and a network interface for connecting to an external network. The software module includes: a self-test program for performing comprehensive self-testing of the system hardware and software; a communication protocol stack for encapsulating, decapsulating, and transmitting network data; and a network management module for configuring, monitoring, and managing the system. The self-test program's self-test items include network card testing, power supply testing, network connectivity testing, and routing table accuracy testing.
[0067] Automation and parallel processing technologies include two parallel execution functions, recv and send. send is used to send data, and recv is used to receive data. recv and send are based on multithreading and asynchronous operation technologies, specifically including: Multithreading technology creates different threads to handle recv and send operations respectively, and multiple threads execute concurrently at the same time, achieving parallel processing of data reception and transmission.
[0068] Asynchronous operation technology allows the recv and send functions to not block other operations in the program when they are executed. After calling the asynchronous recv function, it returns immediately, and the program will not wait for the data to be received before continuing to execute other code.
[0069] Furthermore, in addition to parallel processing, the self-checking program adds a self-verification program (check) to verify the data after processing is complete.
[0070] Parallel processing technology breaks down a task into multiple subtasks and assigns them to different processing units for simultaneous execution. In router network communication systems, the parallel processing of recv and send eliminates the need for data reception and transmission to wait for each other. For example, in a traditional serial communication system, the recv operation is executed first, and the send operation is executed after the data reception is complete. If the recv operation takes 5 seconds and the send operation takes 3 seconds, then completing one data reception and transmission operation takes a total of 8 seconds. However, in the case of parallel processing, recv and send are performed simultaneously, and their execution times overlap. Theoretically, completing these two operations only takes 5 seconds. Taking the longer recv operation as an example, the overall communication time is greatly shortened. To test the efficiency of parallel processing, 100 data transmission tests were conducted. 50 of these tests used serial recv and send operations, while the other 50 used parallel processing. The results showed that the average time for each data transmission was 100 milliseconds in the serial mode, while the average time for each data transmission was 60 milliseconds in the parallel mode. This comparison shows that parallel processing improved data transmission efficiency by approximately 40%.
[0071] In a parallel processing environment, the parallel operation of recv and send, along with the check procedure, forms a powerful multi-verification mechanism. When recv and send work in parallel, they independently perform data reception and transmission operations, allowing data to flow in both directions simultaneously during data transmission. This creates a preliminary cross-verification between them. If the data received by recv matches and corresponds to the data sent by send in terms of quantity, timestamp, etc., then it can be preliminarily concluded that the data transmission is normal on a macroscopic level.
[0072] The continuous monitoring and optimization mechanism is designed with monitoring points around three dimensions: the self-inspection object, the self-inspection process, and the self-inspection results. Specifically, it includes: Self-test object monitoring involves embedding monitoring code at key nodes of the self-test program to collect real-time data and analyze program runtime logs in real time using the ELK tool.
[0073] The self-test process is monitored by tracking the task lifecycle through the monitoring plugin of the scheduled task framework. Combined with the top and nmon monitoring tools in the system, it collects the resource usage data of the self-test program and records the execution result, triggering condition, and associated data of each self-test rule.
[0074] Self-inspection result monitoring involves aggregating and analyzing self-inspection results by anomaly type, module, and other dimensions through a database or data warehouse. Abnormal results are then linked to the work order system to track processing progress, set up result review entry points, and collect manual correction opinions on self-inspection results.
[0075] The optimization goals of the self-inspection process are to shorten execution time, reduce resource waste, and achieve automated closed-loop. Based on the execution time of self-inspection tasks in the monitoring and the off-peak business period, the self-inspection frequency is dynamically adjusted. For example, the core module performs a full self-inspection during the off-peak business period (such as 2-4 am) and performs a spot check of core indicators during the peak period (such as 9-12 am) to reduce the impact on business. For self-inspection tasks that take too long to execute, such as full data verification which takes 1 hour, they are split into verifying only newly added data and once a week to improve real-time performance.
[0076] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A self-testing router network communication system, characterized in that, Includes hardware modules and software modules; The hardware module includes: a central processing unit for executing system instructions and data processing; a storage unit for storing temporary data, basic startup programs and key configuration files; a network interface for connecting to an external network; LEDs for visually displaying the router's working status; and a reset button for restoring the router to factory settings in case of configuration errors, forgotten passwords or system crashes. The storage unit is connected to the CPU via an SPI bus to enable data reading and writing. The software modules include: a routing protocol module for dynamically learning and maintaining routing tables and calculating the optimal forwarding path; a communication protocol stack for encapsulating, decapsulating, and transmitting network data; a network management module for configuring, monitoring, and managing the system; and a self-testing program for comprehensively testing the system hardware and software, wherein the self-testing program checks for hardware faults and data transmission status in the software. The self-test program includes network card testing, power supply testing, network connectivity testing, and routing table accuracy testing. The self-test program also features automation and parallel processing technology, which decomposes the task into multiple sub-tasks and assigns them to different processing units for simultaneous execution, with no interference between the sub-tasks. The self-inspection process incorporates continuous monitoring and optimization mechanisms to enhance self-inspection capabilities, enabling proactive risk assessment and prevention of communication failures. Automation and parallel processing techniques include two parallel execution functions, recv and send. send is used to send data, and recv is used to receive data. recv and send are based on multithreading and asynchronous operation techniques, specifically including: Multithreading technology creates different threads to handle recv and send operations respectively, and multiple threads execute concurrently at the same time, achieving parallel processing of data reception and transmission. Asynchronous operation technology allows the recv and send functions to not block other operations of the program when they are executed. After calling the asynchronous recv function, it returns immediately, and the program will not wait for the data to be received and will continue to execute other code. Furthermore, based on parallel processing, the self-checking program adds a self-verification program (check) to verify the data after processing is complete. Automation and parallel processing technologies can automatically track progress, count the number of completed subtasks in real time, calculate the progress percentage, and automatically trigger alarms for subtasks that have not been completed for a long time, notifying human intervention for investigation. The accuracy of the routing table is checked by comparing it with network topology information. Network topology information records the physical and logical connections between all devices in the network. The routing table stores the target network, next hop, and outgoing interface mappings that the router relies on when forwarding data packets, specifically including: The system obtains the current network topology, including the connection relationships of each network node, IP address allocation, and other information; The routing entries in the routing table are compared one by one with the network topology to check for erroneous routing information, such as routes pointing to unreachable networks or routes with incorrect next-hop addresses. Verify that the routing table is updated in a timely and accurate manner. When the network topology changes, the routing table should be updated within a specified time to ensure that data packets are forwarded along the correct path.
2. The self-testing router network communication system according to claim 1, characterized in that: The network card detection uses a detection program to check its hardware status, including whether the chip is working properly, whether the interface shows signs of damage, and tests its data transmission rate and stability. If the network card's data transmission rate is detected to be significantly lower than normal or the packet loss rate is too high, it is determined that the network card is faulty. The fault may include problems with the network card driver or damage to the network card hardware. Factors that could cause a network card to not be recognized include hardware failure, driver issues, unloaded kernel modules, or incorrect BIOS settings.
3. The self-testing router network communication system according to claim 1, characterized in that: The power supply detection includes monitoring whether the output voltage and current of the power supply are stable within the normal range. Voltage and current detection instruments are used for real-time monitoring. If abnormal fluctuations in voltage or current occur, exceeding ±5% of the normal range, it is determined that there is a potential fault in the power supply. Potential faults include damaged power cord, poor contact of connectors, aging of the power adapter, and damage to internal circuit components.
4. The self-testing router network communication system according to claim 1, characterized in that: The network connectivity detection specifically includes: If you send an ICMP echo request packet to a preset target IP address using the ping command and receive a response packet from the target device in a timely manner, it indicates that the network is connected normally at the P layer. Execute the ping command to test the connectivity between the router and a specific IP address or domain name. Use the traceroute command to trace all router paths a data packet takes from source to destination. By analyzing whether each node in the path responds normally, you can determine whether there are intermediate node failures or routing errors in the network. If a node is found to be unresponsive for a long time or an abnormal route jump occurs during the tracing process, you need to further investigate whether there are problems with the node and related routing configurations.
5. The self-testing router network communication system according to claim 1, characterized in that: The self-test program is triggered in two ways: timed self-test and event-triggered self-test. Specifically, it includes: The scheduled self-test is a proactive and periodic detection mode, which is set to start automatically at regular intervals based on user needs and the actual network conditions. Event-triggered self-check is a passive and immediate detection mode that automatically starts when a specific event occurs in the system. Specific events include system restart, changes in network interface status, and sudden abnormal increases or decreases in network traffic. The self-test procedure follows a logic of hardware testing first, then software testing. While ensuring the hardware modules are functioning normally, it performs software module operation checks, specifically including: Perform basic hardware testing; hardware such as power supply and memory are the foundation for the normal operation of the system. Network connectivity is tested using methods such as local loop detection, gateway connectivity detection, and external network connectivity detection to determine whether the network can communicate normally. The accuracy of the routing table is checked, including local network routes, default routes, and static routes. The destination network address, subnet mask, next-hop address, outgoing interface, and other parameters of each route entry in the routing table are checked to see if they are correct. For networks using dynamic routing protocols, the accuracy of the routing table is checked to see if it can dynamically update route entries according to changes in the network topology. The correctness of the routing table directly affects the forwarding path of network data packets. The self-test results of the self-test program are recorded in a detailed log file. The log file records the time of each self-test, the self-test items, the test results, and possible error information. For each test item, it is clearly recorded whether it passed the test. If the test fails, the error code and error description are recorded in detail to facilitate subsequent troubleshooting and analysis by the administrator.
6. The self-testing router network communication system according to claim 1, characterized in that: The continuous monitoring and optimization mechanism is designed with monitoring points around three dimensions: the self-inspection object, the self-inspection process, and the self-inspection result. Specifically, it includes: Self-test object monitoring involves embedding monitoring code at key nodes of the self-test program, collecting real-time data, and using the ELK tool to analyze the program's runtime logs in real time. Self-test process monitoring: Through the monitoring plugin of the scheduled task framework, the task lifecycle is tracked. Combined with the top and nmon monitoring tools in the system, the resource usage data of the self-test program is collected, and the execution result, triggering condition and related data of each self-test rule are recorded. Self-inspection result monitoring involves aggregating and analyzing self-inspection results by anomaly type, module, and other dimensions through a database or data warehouse. Abnormal results are then linked to the work order system to track processing progress, set up result review entry points, and collect manual correction opinions on self-inspection results.
7. The self-testing router network communication system according to claim 1, characterized in that: The communication protocol stack includes the application layer, transport layer, network layer, data link layer, and physical layer. The router mainly operates at the network layer, and its data transmission process specifically includes: Data is received through the network interface, identified and classified according to the protocol type of the data packets. For TCP protocol data, the TCP header information is checked, including the source port, destination port, sequence number, acknowledgment number, etc., to ensure the integrity and correctness of the data packets. The data is then passed to the TCP protocol processing module for processing, which includes establishing a TCP connection, ensuring reliable data transmission, handling data packet retransmission and acknowledgment. For UDP protocol data, check the UDP header information, including the source port, destination port, and data length, and then directly pass the data to the corresponding application. When forwarding data, the next-hop address of the data packet is determined based on the routing table information. Among multiple routes, the best path is selected according to the routing algorithm, and the data packet is sent to the network interface corresponding to the next-hop address and then sent out.
8. A self-testing router network communication system according to claim 7, characterized in that: The routing algorithm used for forwarding data considers factors such as network link bandwidth, latency, load, and node reliability. The system assigns a metric to each network link. The metric comprehensively reflects various performance indicators of the link, including links with higher bandwidth, lower latency, and lighter load. These links are assigned lower metric values, indicating that the link is a better choice. The system periodically collects performance information of each network link, updates the link metrics in real time, searches for available route entries in the routing table based on the destination address, calculates the sum of the link metrics corresponding to each route entry, and selects the route with the smallest sum of metrics as the best path.
Citation Information
Patent Citations
Wireless router access method and system
CN117793857B
OpenWRT router, ONU and gateway network self-checking method and system
CN118714036A
Wireless router network communication quality assurance system
CN118764898B