Network communication method and device and multi-master-control network communication system

By introducing a sub-device-side anomaly detection and self-recovery mechanism into multi-master network devices, rapid fault location and self-recovery are achieved, solving the problems of low fault location efficiency and high maintenance costs in existing technologies, and improving the system's operational stability and communication recovery speed.

CN121664634APending Publication Date: 2026-03-13TP-LINK
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

When existing multi-master network devices experience issues such as some links being down, individual master control boards experiencing service abnormalities, or internal network conflicts, the management terminal can only see the entire device being offline or the channel being abnormal, resulting in low fault location efficiency and high maintenance costs.

Method used

A sub-device anomaly detection and self-recovery mechanism with a preset time limit is introduced. Through the collaborative processing of the main device and sub-devices, rapid self-diagnosis and self-recovery are achieved. The number of abnormal sub-devices is distinguished and graded, reducing the number of whole machine restarts and manual troubleshooting.

Benefits of technology

It improves the fault location accuracy and communication recovery speed of multi-master network devices, reduces the number of machine restarts and manual maintenance, and enhances system operation stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121664634A_ABST
    Figure CN121664634A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of network communication, and provides a network communication method and device and a multi-master-control network communication system.The method comprises the steps that when any sub-device detects that communication with a master device is in an abnormal state, and the abnormal duration exceeds a first preset duration, it is determined that the sub-device is an abnormal sub-device, executing a first processing operation by the abnormal sub-device so as to perform self-recovery; when the sub-devices which are not recovered to the normal communication state in the second preset time length exist, the main device detects the communication state between at least one sub-device and the main device, and the number of abnormal sub-devices in the multiple sub-devices is determined; when one abnormal sub-device exists, executing a second processing operation by the main device; and when a plurality of abnormal sub-devices exist, executing a third processing operation by the main device. According to the scheme, the whole machine restart and manual troubleshooting times can be reduced through grading diagnosis and recovery, and the system operation stability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and in particular to a network communication method, apparatus and multi-master network communication system. Background Technology

[0002] In the field of video surveillance, in order to improve the overall computing power and functional expansion capabilities, multi-master network devices that integrate multiple master control boards within the same chassis have gradually emerged. Examples include cameras that integrate both fixed bullet and PTZ camera functions. These devices typically use a switching chip to connect each master control board to the same network port, and externally function as a single network node connected to the user network or management platform.

[0003] In existing technologies, network anomaly handling for such multi-master control devices primarily remains at the system-wide level. On one hand, monitoring platforms typically determine camera offline status using simple heartbeat or session timeout checks. When an anomaly is detected, most practices only support sending alarm notifications to maintenance personnel or remotely issuing a system-wide restart command, without distinguishing the specific status of different master control boards or network devices within the device. On the other hand, even if watchdog times or automatic restart mechanisms are implemented at the device level, they often involve uniform resets of the entire system or a single master control board.

[0004] In this situation, when some links of multi-master network devices are down, individual master control boards have abnormal services, or there are internal network conflicts, the management end often only sees the entire machine offline or the channel abnormal. Maintenance personnel need to troubleshoot by powering on and off on-site and replacing motherboards one by one. The fault location process relies on experience, which is inefficient and has high maintenance costs in large-scale deployment scenarios. Summary of the Invention

[0005] This application provides a network communication method, device, and multi-master network communication system, which can realize rapid location and automatic self-recovery of abnormal sub-devices or related network devices, thereby reducing manual maintenance and the number of system restarts, and improving the overall communication stability and operational reliability of the system.

[0006] A first aspect provides a network communication method applied to a multi-master network communication system, the system comprising a master device, at least one sub-device, and switching chips connected to the master device and each sub-device, wherein the master device and each sub-device respectively include a master control processing unit and a network interface connected to the master control processing unit; the method includes: When any of the sub-devices detects that the communication with the master device is in an abnormal state and the abnormal duration exceeds a first preset duration, the sub-device is determined to be an abnormal sub-device, and the abnormal sub-device performs a first processing operation to perform self-recovery; When there is a sub-device that has not recovered to normal communication status within a second preset time period, the master device detects the communication status between at least one sub-device and the master device, and determines the number of abnormal sub-devices among the multiple sub-devices. When an abnormal sub-device exists, the master device performs a second processing operation, which includes: performing self-diagnosis and self-recovery on the master device's main control processing unit, network interface, and switching chip port connected to the abnormal sub-device; When multiple abnormal sub-devices exist, the main device performs a third processing operation, which includes self-diagnosis and self-recovery of the main control processing unit, network interface, and switching chip port connected to the main device.

[0007] In the technical solution of this application, in a multi-master control network communication system including a master device, at least one sub-device, and a switching chip, a sub-device-side anomaly determination and self-recovery is introduced, with a first preset time as the boundary. When any sub-device detects a communication anomaly with the master device that lasts for more than the first preset time, it is identified as an abnormal sub-device and performs a first processing operation locally, achieving rapid self-diagnosis and self-recovery near the fault point, avoiding an initial restart of the master device or the entire machine. Furthermore, when there are still sub-devices that have not recovered to normal communication status within a second preset time, the master device detects the communication status between each sub-device and the master device and determines the number of abnormal sub-devices, separating those with only one abnormal sub-device from those with multiple abnormal sub-devices. The scenarios involving multiple abnormal sub-devices are differentiated: when only one abnormal sub-device exists, the master device performs a second processing operation, self-diagnosing and self-recovering its own main control processing unit, network interface, and the switch chip port connected to the abnormal sub-device; when multiple abnormal sub-devices exist, the master device performs a third processing operation, self-diagnosing and self-recovering its own main control processing unit, network interface, and the switch chip port connected to the master device. This forms a collaborative mechanism of "sub-device local self-recovery + master device hierarchical processing based on the number of abnormalities," improving the fault location accuracy and communication recovery speed of multi-master network devices, reducing the number of whole-machine restarts and manual troubleshooting, and enhancing system operational stability.

[0008] In conjunction with the first aspect, in some embodiments of the first aspect, the network interface in the master device and each of the sub-devices includes a link layer unit connected to the master control processing unit and a physical layer unit connected to the link layer unit; The link layer unit is used to send and receive data link layer messages, and the physical layer unit is used to send and receive physical layer signals.

[0009] In this implementation, by dividing the network interface into link layer units and physical layer units, fault location becomes more precise and subsequent diagnostic processing becomes more targeted.

[0010] In one possible implementation, the first processing operation includes: The network parameters of the main control processing unit of the abnormal sub-device are detected, and the network parameters are reconfigured when the detection result is abnormal. The connection status and negotiation parameters of the link layer unit and the physical layer unit of the abnormal sub-device are detected, and the network interface is reset when the detection result is abnormal. The connection status, operating mode, and negotiation parameters of the physical layer unit of the abnormal sub-device are detected. If the detection result is abnormal, the physical layer unit is configured to loopback operating mode and loopback communication test is performed. If the loopback communication test result is abnormal, the physical layer unit is reset.

[0011] In this implementation, by progressively detecting and looping back the network parameters, link layer units, and physical layer units of the abnormal sub-device, complete self-testing and self-recovery on the sub-device side is achieved, shortening the fault recovery time.

[0012] In one possible implementation, the second processing operation further includes: Before performing self-diagnosis and self-recovery on the main control processing unit, network interface, and switching chip port connected to the abnormal sub-device of the main device, control the abnormal sub-device to power on and restart.

[0013] In this implementation, by controlling the abnormal sub-device to power on and restart before the master device performs self-diagnosis and self-recovery on its main control processing unit, network interface, and switching chip port connected to the abnormal sub-device, the long restart process (minutes) of the sub-device and the short self-test and self-recovery process (seconds) of the master device can be performed in parallel. This reduces the overall fault recovery time without adding extra waiting time and speeds up the recovery of communication between the master device and the abnormal sub-device. By controlling the abnormal sub-device to power on before the master device performs self-diagnosis, and by prioritizing the elimination of faults in the sub-device itself, unnecessary troubleshooting on the master device side can be reduced.

[0014] In one possible implementation, the self-diagnosis and self-recovery of the main control processing unit, network interface, and switching chip port connected to the abnormal sub-device of the main device includes: The network parameters of the main control processing unit of the main device are detected, and the network parameters are reconfigured when the detection result is abnormal. After reconfiguration, the network parameters of the main control processing unit of the main device are checked again. If the result of the second check is abnormal, the first abnormal information of the main control processing unit is recorded. The status and configuration of the switching chip port connected to the abnormal sub-device are detected. If the detection result is abnormal, the switching chip is reconfigured and the port is set to loopback mode for communication testing. If the loopback communication test result is abnormal, the physical layer unit corresponding to the port and / or the switching chip is reset. If the loopback communication test result is still abnormal after the reset, the second abnormal information of the switching chip port is recorded.

[0015] In this implementation, the network faults on the main device side are accurately located and classified by reconfiguring the network parameters and switching chip ports of the main device, performing loopback tests, and recording abnormal information.

[0016] In one possible implementation, the self-diagnosis and self-recovery of the main control processing unit, network interface, and switching chip port connected to the abnormal sub-device of the main device further includes: During the self-diagnosis process of the switching chip port connected to the abnormal sub-device, if any detection result is normal or all detection results are abnormal, the communication status between the main device and the abnormal sub-device is detected again within the third preset time after the self-diagnosis. The detection result includes one of the status and configuration detection results of the switching chip port connected to the abnormal sub-device, the loopback communication test result, and the loopback communication test result after reset. If the communication status between the master device and the abnormal sub-device is abnormal at the end of the third preset time period, then the third abnormal information of the abnormal sub-device is recorded, and the master device is controlled to restart. After restarting, the communication status between the master device and the abnormal sub-device is checked again. If the detection result is abnormal, the master device and the abnormal sub-device are reset. After the reset, the communication status between the master device and the abnormal sub-device is checked again. If the detection result is abnormal, the abnormal information is reported to the management terminal. The abnormal information includes the first abnormal information, the second abnormal information, the third abnormal information, and the abnormal location of each abnormal information. If the communication status between the master device and the abnormal sub-device is in a normal state at the end of the third preset time period, or in a normal state after restarting, or in a normal state after resetting, then the self-recovery is determined to be complete.

[0017] In this embodiment, after the third preset time period following the completion of the self-diagnostic process of the switching chip port connected to the abnormal sub-device, the abnormality is recorded, restarted, reset, and reported sequentially, establishing a phased recovery and alarm mechanism from minor to severe, thereby improving the system's self-healing and operation and maintenance efficiency.

[0018] In one possible implementation, the third processing operation includes: The network parameters, connection status, and negotiation parameters of the main control processing unit of the main device are detected. If the detection result is abnormal, the network parameters are reconfigured and / or the link layer unit and physical layer unit are reset. The status and configuration of the switching chip port used for communication with the master device are detected. If the detection result is abnormal, the switching chip is reconfigured and the port is set to loopback mode for communication testing. If the loopback communication test result is abnormal, the physical layer unit and / or the switching chip corresponding to the port are reconfigured or reset. If the loopback communication test result is still abnormal, the fourth abnormal information of the port is recorded. If, during the self-diagnosis process of the switching chip port connected to the main device, any detection result is normal or all detection results are abnormal, then within the fourth preset time after the self-diagnosis, the communication status between the main device and the plurality of abnormal sub-devices is detected again. The detection result includes one of the status and configuration detection results of the switching chip port connected to the main device, the loopback communication test result, and the loopback communication test result after reset. If the communication status between the master device and the multiple abnormal sub-devices is in an abnormal state at the end of the fourth preset time period, the master device and all sub-devices are controlled to be reset. If the communication between the master device and the multiple abnormal sub-devices still does not return to normal after the reset, abnormal information is reported to the management terminal. The abnormal information also includes a fourth abnormal information and the abnormal location of the fourth abnormal information.

[0019] In this implementation, by uniformly diagnosing the main equipment and switching chips when multiple sub-devices malfunction, and combining this with system-wide reset and anomaly reporting, public network resources can be repaired first and systemic faults can be quickly identified.

[0020] In one possible implementation, the network parameters include at least a network address, subnet mask, and gateway information; the status and configuration of the switching chip port include at least a virtual LAN configuration, port connection status, operating mode, and negotiation parameters.

[0021] In this implementation, by limiting the key content of network parameters and switching chip port configuration, it is ensured that anomaly detection covers the main configuration items that affect connectivity, thereby improving the accuracy of anomaly identification.

[0022] In a second aspect, a network communication device is provided, configured in a multi-master network communication system, the system including a master device, at least one sub-device, and switching chips connected to the master device and each sub-device, the master device and each sub-device respectively including a master control processing unit and a network interface connected to the master control processing unit; the device includes: The sub-device detection module is used to determine that the sub-device is an abnormal sub-device when any of the sub-devices detects that the communication with the master device is in an abnormal state and the abnormal duration exceeds a first preset time. The abnormal sub-device then performs a first processing operation to perform self-recovery. The main device detection module is used to detect the communication status between at least one sub-device and the main device when there is a sub-device that has not recovered normal communication status within a second preset time period, and to determine the number of abnormal sub-devices among the multiple sub-devices. The first recovery module is used to have the main device perform a second processing operation when there is an abnormal sub-device. The second processing operation includes: performing self-diagnosis and self-recovery on the main control processing unit, network interface and switching chip port connected to the abnormal sub-device of the main device. The second recovery module is used to perform a third processing operation by the main device when there are multiple abnormal sub-devices. The third processing operation includes self-diagnosis and self-recovery of the main control processing unit, network interface and switching chip port connected to the main device.

[0023] Thirdly, a multi-master network communication system is provided, the system comprising: a master device, at least one sub-device, and a switching chip connected to the master device and each sub-device, wherein the master device and each sub-device respectively include a master control processing unit and a network interface connected to the master control processing unit, for performing the method described in the first aspect above.

[0024] Fourthly, a chip is provided, including a processor for reading and executing a computer program stored in a memory, wherein the computer program, when executed by the processor, is capable of implementing any of the methods of the first aspect.

[0025] Optionally, the chip also includes a memory electrically connected to the processor.

[0026] Optionally, the chip may also include a communication interface.

[0027] Fifthly, a computer-readable storage medium is provided that stores a computer program that, when executed by a processor, can implement any of the methods of the first aspect.

[0028] In a sixth aspect, a computer program product is provided, comprising a computer program that, when executed by a processor, can implement any of the methods of the first aspect. Attached Figure Description

[0029] Figure 1 This is a flowchart illustrating a network communication method provided in an embodiment of this application; Figure 2 This is a flowchart corresponding to the first processing operation; Figure 3 This is a flowchart corresponding to the second processing operation; Figure 4 This is a flowchart illustrating the third processing operation; Figure 5 This is a schematic diagram of the structure of a network communication device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a multi-master network communication system provided in an embodiment of this application. Detailed Implementation

[0030] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0031] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0032] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0033] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0034] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0035] It should be understood that the sequence number of each step in this embodiment does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application embodiment.

[0036] In the field of video surveillance, in order to improve the overall computing power and functional expansion capabilities, multi-master network devices that integrate multiple master control boards within the same chassis have gradually emerged. Examples include cameras that integrate both fixed bullet and PTZ camera functions. These devices typically use a switching chip to connect each master control board to the same network port, and externally function as a single network node connected to the user network or management platform.

[0037] In existing technologies, network anomaly handling for such multi-master control devices primarily remains at the system-wide level. On one hand, monitoring platforms typically determine camera offline status using simple heartbeat or session timeout checks. When an anomaly is detected, most practices only support sending alarm notifications to maintenance personnel or remotely issuing a system-wide restart command, without distinguishing the specific status of different master control boards or network devices within the device. On the other hand, even if watchdog times or automatic restart mechanisms are implemented at the device level, they often involve uniform resets of the entire system or a single master control board.

[0038] In this situation, when some links of multi-master network devices are down, individual master control boards have abnormal services, or there are internal network conflicts, the management end often only sees the entire machine offline or the channel abnormal. Maintenance personnel need to troubleshoot by powering on and off on-site and replacing motherboards one by one. The fault location process relies on experience, which is inefficient and has high maintenance costs in large-scale deployment scenarios.

[0039] To address the aforementioned issues, this application provides a network communication method, apparatus, and multi-master network communication system. In this system, which includes a master device, at least one sub-device, and a switching chip, a sub-device-side anomaly detection and self-recovery mechanism is introduced, defined by a first preset time period. When any sub-device detects a communication anomaly with the master device that persists for more than the first preset time period, it is identified as an abnormal sub-device and a first processing operation is performed locally. This enables rapid self-diagnosis and self-recovery near the fault point, avoiding an initial restart of the master device or the entire system. Furthermore, if any sub-device fails to restore normal communication within a second preset time period, the master device detects the communication status between each sub-device and the master device and identifies the abnormal sub-device. The system differentiates between scenarios with only one faulty sub-device and scenarios with multiple faulty sub-devices: When there is only one faulty sub-device, the master device performs a second processing operation, self-diagnosing and self-recovering its own main control processing unit, network interface, and the switch chip port connected to the faulty sub-device; when there are multiple faulty sub-devices, the master device performs a third processing operation, self-diagnosing and self-recovering its own main control processing unit, network interface, and the switch chip port connected to the master device. This forms a collaborative mechanism of "sub-device local self-recovery + master device hierarchical processing based on the number of faults," improving the fault location accuracy and communication recovery speed of multi-master network devices, reducing the number of whole-machine restarts and manual troubleshooting, and improving system operational stability.

[0040] The specific implementation method is described below with reference to the illustrations.

[0041] See Figure 1 This illustration shows a flowchart of a network communication method provided in an embodiment of this application. The method is applied to a multi-master network communication system, wherein the system includes a master device, at least one sub-device, and switching chips connected to the master device and each sub-device. The master device and each sub-device each include a master control processing unit and a network interface connected to the master control processing unit. Figure 1 As shown, the method may include the following steps: Step 101: When any sub-device detects that the communication with the master device is in an abnormal state and the abnormal duration exceeds the first preset duration, the sub-device is determined to be an abnormal sub-device, and the abnormal sub-device performs the first processing operation to perform self-recovery.

[0042] It should be noted that the multi-master network communication system in this application embodiment can be the network system inside an integrated camera, that is, the camera is equipped with n master control boards, each master control board is equipped with a master control processing unit and a network interface connected to the master control processing unit, and each network interface is connected to the camera's external network interface through the same switching chip, so as to access the user network or management terminal in the form of a single network node.

[0043] The master device refers to the main control board selected from the aforementioned n master control boards to undertake centralized management and external communication functions. The master device is responsible not only for communicating with the external management terminal, summarizing the status information of each sub-device, and issuing control commands, but also for providing power or control signals to the switching chip, related circuits within the master device's network interface, and each sub-device through its own power supply and control circuits. The master device can be arbitrarily selected from the n master control boards, for example, determined through software configuration or preset strategies during factory configuration or system startup.

[0044] In this context, sub-devices refer to main control boards other than the main device. Each sub-device also includes a main control processing unit and a network interface connected to the main control processing unit. It establishes a service channel and / or heartbeat channel with the main device through a switching chip for reporting service data and operating status. The power supply pins of each sub-device can be centrally connected to the power supply and control path on the main device side, and the main device centrally manages power-on, reset, and other actions.

[0045] Among them, communication in an abnormal state means that communication between the sub-device and the master device based on the service channel and / or heartbeat channel fails to be completed normally according to the preset rules. For example, the master device fails to respond to the heartbeat message multiple times in a row, the service request is unresponsive for a long time, or the link detection result is disconnected, thus the reliability of data interaction cannot be guaranteed.

[0046] Specifically, based on the application scenario provided above (i.e., the network system inside the integrated camera), the specific execution process of step 101 is as follows: After the camera is powered on and initialized, the main device and each sub-device establish a service channel and / or heartbeat channel through a switching chip. Each sub-device monitors its communication status with the main device at a preset detection cycle. When a sub-device detects an abnormal communication status with the main device for multiple consecutive detection cycles, it begins to accumulate the duration of the abnormality. When the accumulated abnormal duration exceeds a first preset duration, the sub-device marks itself as an abnormal sub-device locally and stores this mark in a local state register or memory variable. Subsequently, the abnormal sub-device immediately calls the program module corresponding to the first preset processing operation to initiate a self-recovery process, checking and recovering the modules related to its communication with the main device in an attempt to restore communication with the main device without affecting the normal operation of other sub-devices and the main device.

[0047] For example, a camera may have four main control boards connected to the external network via the same switching chip. One of these boards is selected as the master device, and the other three are designated as slave devices. Each slave device sends a heartbeat message to the master device every second and records the heartbeat response locally. The system sets a first preset duration of 10 seconds. If a slave device fails to receive a valid response from the master device after sending 10 consecutive heartbeats, it is determined that communication with the master device has been abnormal for 10 consecutive seconds, exceeding the first preset duration. The slave device then marks itself as an abnormal slave device locally and triggers the first processing operation. At this point, the abnormal slave device automatically runs a preset self-recovery program on its main control processing unit, performing self-checks and recovery attempts on local network configuration and communication-related modules to restore communication with the master device as quickly as possible without forcibly restarting other slave devices or the master device. By using the above method, when a link anomaly occurs in a sub-device within a multi-master camera, self-recovery can be triggered locally on that sub-device, which helps to reduce the scope of the fault and improve the availability of the entire multi-master network communication system.

[0048] In one possible implementation, the network interface in the master device and each sub-device includes a link layer unit connected to the master control processing unit and a physical layer unit connected to the link layer unit; wherein, the link layer unit is used to implement the sending and receiving of data link layer messages, and the physical layer unit is used to implement the sending and receiving of physical layer signals.

[0049] In this embodiment, the network interfaces of the master device and each sub-device can adopt a layered structure design, including a link layer unit connected to the master control processing unit and a physical layer unit connected to the link layer unit. The link layer unit is used to complete message transmission and reception, frame encapsulation and decapsulation, verification, and data interaction with the master control processing unit related to the data link layer; the physical layer unit is used to convert the electrical / logic signals output by the link layer unit into signals on the physical medium, or to restore the received physical layer signals into electrical / logic signals for processing by the link layer unit, so as to realize physical connection with the external network.

[0050] In one specific implementation, the link layer unit can be configured as a standalone MAC (Media Access Control) chip or integrated into the main control processing unit as a MAC function module. This module controls the transmission and reception of Ethernet data frames, identifies addresses, and facilitates high-speed data exchange with the main control processing unit. The physical layer unit can be configured as a physical layer (PHY) chip, connected to the MAC chip via a standard interface. This PHY chip performs functions such as encoding, decoding, modulation, demodulation, and link negotiation for Ethernet physical layer signals. By implementing the link layer unit as a MAC chip and the physical layer unit as a PHY chip, mature Ethernet MAC / PHY devices can be used to design the network interfaces for the main device and each sub-device. This simplifies hardware implementation and improves system compatibility and stability while meeting the functional requirements of the network communication method described in this application.

[0051] In another possible implementation, the first processing operation includes: The network parameters of the main control processing unit for detecting abnormal sub-devices are reconfigured when the detection result is abnormal. The system detects the connection status and negotiation parameters between the link layer unit and the physical layer unit of the abnormal sub-device, and resets the network interface when the detection result is abnormal. The system detects the connection status, operating mode, and negotiation parameters of the physical layer unit of the abnormal sub-device. When the detection result is abnormal, the physical layer unit is configured to loopback operating mode and loopback communication test is performed. When the loopback communication test result is abnormal, the physical layer unit is reset.

[0052] The network parameters include at least the network address, subnet mask, and gateway information.

[0053] Specifically, the malfunctioning sub-device first checks the network parameters of its own main control processing unit. These parameters may include the network address, subnet mask, gateway, and routing configuration used by the sub-device to communicate with the main device. If the check result is abnormal, the malfunctioning sub-device reconfigures these network parameters according to a preset configuration template or parameters obtained from the main device to eliminate communication anomalies caused by incorrect network parameters. Subsequently, the malfunctioning sub-device continues to check the connection status and negotiation parameters between the link layer unit and the physical layer unit in its network interface, such as whether the link is established, the negotiation rate, and the duplex mode are within the expected range. If the check result is abnormal, the network interface is reset, causing the link layer unit and the physical layer unit to re-negotiate and initialize the link. Further, the malfunctioning sub-device also checks the connection status, operating mode, and negotiation parameters of the physical layer unit itself. If the check result is abnormal, the physical layer unit is configured to loopback operating mode and a loopback communication test is performed to verify whether the physical layer transmit / receive path is normal. If the loopback communication test result is still abnormal, the physical layer unit is reset, causing it to power on and initialize again to attempt to restore the normal operating state of the physical layer. Through the above processing, the abnormal sub-device can complete multi-level self-checks and recovery locally, from network parameters, the connection relationship between link layer units and physical layer units to the status of the physical layer unit itself.

[0054] As an illustrative example of the first processing operation described above, such as Figure 2 As shown, in a specific embodiment, the sub-device first performs periodic monitoring of its communication status with the master device: when the duration of the abnormal communication between the sub-device and the master device exceeds a first preset duration, it enters the first processing operation flow; if the first preset duration is not exceeded, it returns to continue monitoring the communication status.

[0055] Specifically, such as Figure 2 As shown, after entering the first processing operation, the abnormal sub-device first determines whether the network parameters of the main control processing unit of the abnormal sub-device are normal. If the detection is normal, the process proceeds to the next step; if the detection result is abnormal, "network parameter reconfiguration" is performed, that is, the network parameters such as network address, subnet mask, and gateway information are reconfigured according to preset rules. After the configuration is completed, the process returns to re-detect the network parameters of the main control processing unit until they are detected as normal. In actual implementation, the abnormal sub-device can call the network configuration query function of the operating system, such as executing ifconfig or ip commands to read the current IP, subnet mask, gateway configuration, and interface status, and automatically modify the relevant network parameters according to the preset template when a configuration error or an interface is not enabled is detected.

[0056] Subsequently, the malfunctioning sub-device determines whether the connection status and negotiation parameters between its link layer unit and physical layer unit are normal. If normal, it continues with subsequent steps; if malfunctioning, it performs a "network interface reset," resetting the network interface and causing the link layer unit and physical layer unit to re-negotiate the link. After the reset, it returns to re-detect the connection status and negotiation parameters until normal is detected. In actual implementation, the link layer unit can be a MAC unit that implements data link layer functions, and the physical layer unit can be a PHY unit that implements physical layer transmission and reception. The malfunctioning sub-device can read parameters such as whether the link between the MAC and PHY is established, the current negotiation rate, and the duplex mode through an interface similar to ethtool or mii-tool, and triggers a network interface reset operation when an malfunction is detected.

[0057] After completing the above steps, the abnormal sub-device further determines whether the connection status, operating mode, and negotiation parameters of the physical layer unit of the abnormal sub-device are normal. If the detection is normal, the physical layer is considered to be working normally, and the first processing operation ends. If the detection is abnormal, the "configure loopback operating mode for the physical layer unit" is executed, switching the physical layer unit to loopback operating mode and checking whether the communication in the loopback operating mode of the physical layer unit is normal. If the communication detection is normal in loopback mode, the system returns to re-check the connection status, operating mode, and negotiation parameters of the physical layer unit. If the communication detection is still abnormal in loopback mode, the "physical layer unit reset" is executed, resetting the physical layer unit to power on and initialize it again. After the reset is completed, the system returns to check the status of the physical layer unit again. In actual implementation, the abnormal sub-device can access the registers of the physical layer unit through tools such as phytool or mdio-tool, configure it to enter loopback operating mode, and send / receive test messages. The success of loopback communication determines whether the physical layer transmit / receive path is normal. If multiple loopback tests fail, a hard reset is performed on the physical layer unit by controlling the power supply or the reset pin.

[0058] pass Figure 2 The flowchart illustrates the specific execution sequence of the abnormal sub-device cyclically detecting, reconfiguring, and resetting the network parameters of the main control processing unit, the connection relationship between the link layer unit and the physical layer unit, and the status of the physical layer unit itself after the communication abnormality exceeds the first preset time.

[0059] Step 102: When there is a sub-device that has not recovered to normal communication status within the second preset time period, the master device detects the communication status between at least one sub-device and the master device, and determines the number of abnormal sub-devices among the multiple sub-devices.

[0060] Communication status detection refers to the process by which the master device, based on the established service channels and / or heartbeat channels with each sub-device, determines whether each sub-device is currently online, whether the link is unobstructed, and whether service messages can be exchanged normally. The master device can periodically receive heartbeat messages, status reports, or service responses from each sub-device, and can also periodically send probe messages to the sub-devices, judging the communication status of the corresponding sub-device based on whether a valid response is received within a predetermined time.

[0061] Communication status detection refers to the process by which the master device, based on the established service channels and / or heartbeat channels with each sub-device, determines whether each sub-device is currently online, whether the link is unobstructed, and whether service messages can be exchanged normally. The master device can periodically receive heartbeat messages, status reports, or service responses from each sub-device, and can also periodically send probe messages to the sub-devices, judging the communication status of the corresponding sub-device based on whether a valid response is received within a predetermined time.

[0062] The number of abnormal sub-devices refers to the number of sub-devices whose communication status is still determined to be abnormal after the second preset time period ends, based on the communication status detection results. The master device can maintain a communication status flag for each sub-device and update the flag according to conditions such as heartbeat timeout and session failure during the detection period. The number of sub-devices in an abnormal state is then counted to obtain the number of abnormal sub-devices.

[0063] In one specific implementation, when the sub-device has already performed the first processing operation according to step 101, the master device continuously monitors the communication status between each sub-device and the master device in the background, and starts a second preset timer for sub-devices that have not recovered normal communication status from the time the first processing operation was performed. At the end of the second preset timer, the master device iterates through all sub-devices and checks the communication status flag of each sub-device in the most recent one or more detection periods: if a sub-device has no heartbeat response or service interaction failure during the time period, the sub-device is marked as communication abnormal; if both heartbeat and service interaction are normal, it is marked as communication normal. Based on the marking results, the master device counts the sub-devices in abnormal status, obtains the number of abnormal sub-devices among the current multiple sub-devices, and saves the number and the corresponding sub-device identifier in the internal status information to provide a basis for subsequent processing steps.

[0064] Step 103: When an abnormal sub-device exists, the master device performs the second processing operation.

[0065] The second processing operation includes: performing self-diagnosis and self-recovery on the main control processing unit, network interface, and switching chip port connected to the abnormal sub-device of the main device; by limiting the second processing operation to the scenario of "only one abnormal sub-device", the scope of the problem can be narrowed down to the links and main device side modules related to the sub-device, avoiding unnecessary interference to other normal sub-devices.

[0066] In one specific implementation, in step 102, the master device, based on the communication status detection results with each sub-device, determines that only one abnormal sub-device exists and internally records the identifier of the abnormal sub-device. Subsequently, the master device initiates a second processing operation. First, it performs self-diagnosis on its own main control processing unit, such as reading the network parameters currently used for communication with the switching chip and external communication, and checking for configuration errors or abnormal statuses. If an abnormality is detected, the master device adjusts or reinitializes the relevant network parameters to restore the network operating status on the main control processing unit side. Next, the master device performs self-diagnosis on its own network interface, including checking the link status and negotiation parameters with the switching chip. When an abnormality is detected, it performs corresponding self-recovery operations on the network interface to re-establish a normal connection with the switching chip. Then, the master device further performs self-diagnosis on the switching chip port corresponding to the abnormal sub-device, such as detecting the port's current enable status, port mode, and forwarding configuration. When an abnormality is detected, it completes self-recovery by adjusting and reinitializing the port's configuration. Through the second processing operation described above, the main device can perform targeted self-diagnosis and self-recovery of the main control processing unit, network interface, and switching chip port connected to the abnormal sub-device when there is only one abnormal sub-device, thereby improving the automatic repair capability of single link failure.

[0067] In one possible implementation, the second processing operation further includes: Before performing self-diagnosis and self-recovery on the main control processing unit, network interface, and switching chip port connected to the abnormal sub-device of the main device, control the abnormal sub-device to power on and restart.

[0068] In this implementation, before the master device performs self-diagnosis and self-recovery on its main control processing unit, network interface, and the switching chip port connected to the malfunctioning sub-device, it first controls the malfunctioning sub-device to power on and restart. This allows the sub-device's time-consuming restart process (minutes) to run in parallel with the master device's shorter self-test and self-recovery process (seconds). This reduces the overall fault recovery time without adding extra waiting time and speeds up the recovery of communication between the master device and the malfunctioning sub-device. Furthermore, it prioritizes eliminating faults in the sub-device itself, reducing unnecessary troubleshooting on the master device side.

[0069] In another possible implementation, self-diagnosis and self-recovery are performed on the main control processing unit, network interface, and switching chip port connected to the malfunctioning sub-device of the main device, including: The network parameters of the main control processing unit of the main device are detected, and the network parameters are reconfigured when the detection result is abnormal. After reconfiguration, the network parameters of the main control processing unit of the main device are checked again. If the result of the second check is abnormal, the first abnormal information of the main control processing unit is recorded. The status and configuration of the switching chip port connected to the abnormal sub-device are detected. When the detection result is abnormal, the switching chip is reconfigured and the port is set to loopback mode for communication testing. When the loopback communication test result is abnormal, the physical layer unit and / or switching chip corresponding to the port is reset. When the loopback communication test result is still abnormal after the reset, the second abnormal information of the switching chip port is recorded.

[0070] The status and configuration of the switching chip port include at least the virtual LAN configuration, port connection status, working mode, and negotiation parameters.

[0071] Specifically, when the master device determines that there is only one abnormal sub-device and enters the second processing operation, the master device first checks the network parameters of its own main control processing unit. The network parameters may include configuration items such as network address, subnet mask and gateway. If the detection result is abnormal, the network parameters are reconfigured according to the preset correct configuration, and the network parameters of the main control processing unit are checked again after completion. If the second detection still shows abnormality, the corresponding first abnormal information is recorded in the master device for subsequent fault location and reporting.

[0072] Subsequently, the master device detects the switch chip port connected to the malfunctioning sub-device, obtaining the port's status and configuration parameters, such as port enable status, virtual LAN configuration, operating mode, and negotiation parameters. If the detection result is abnormal, the switch chip is reconfigured to restore the port to its expected operating configuration. Afterward, the master device sets the port to loopback mode and performs a loopback communication test to verify the normal transmission and reception paths of the port and its corresponding physical layer unit. If the loopback communication test result is abnormal, a reset operation is performed on the physical layer unit and / or switch chip corresponding to the port, attempting to restore normal operation again. If the loopback communication test result is still abnormal after the reset, the master device records a second abnormality information for the switch chip port to provide precise location and cause clues when reporting to the management terminal later.

[0073] In another possible implementation, the self-diagnosis and self-recovery of the main control processing unit, network interface, and switching chip port connected to the faulty sub-device of the main device further includes: During the self-diagnosis process of the switching chip port connected to the abnormal sub-device, if any detection result is normal or all detection results are abnormal, the communication status between the master device and the abnormal sub-device will be detected again within the third preset time after the self-diagnosis. Any detection result includes one of the status and configuration detection results of the switching chip port connected to the abnormal sub-device, the loopback communication test result, and the loopback communication test result after reset. If the communication status between the master device and the abnormal sub-device is abnormal at the end of the third preset time period, the third abnormal information of the abnormal sub-device is recorded, and the master device is controlled to restart. After restarting, the communication status between the master device and the abnormal sub-device is checked again. If the detection result is abnormal, the master device and the abnormal sub-device are controlled to reset. After resetting, the communication status between the master device and the abnormal sub-device is checked again. If the detection result is abnormal, the abnormal information is reported to the management terminal. The abnormal information includes the first abnormal information, the second abnormal information, the third abnormal information, and the abnormal location of each abnormal information. If the communication status between the master device and the abnormal sub-device is normal at the end of the third preset time period, or is normal after restarting, or is normal after resetting, then the self-recovery is confirmed to be complete.

[0074] Specifically, after the master device completes self-diagnosis and self-recovery of its main control processing unit, network interface, and the switching chip port connected to the abnormal sub-device, the master device continues to monitor the communication status between itself and the abnormal sub-device for a third preset time period. The third preset time period can be configured based on the execution time of the aforementioned self-diagnosis and self-recovery operations and the buffer time for network recovery. For example, it can be set to a time of tens of seconds to several minutes after the self-diagnosis and self-operation, used to determine whether the link has returned to normal within the third preset time period after the aforementioned recovery action is completed. If the communication status between the master device and the abnormal sub-device is still determined to be abnormal at the end of the third preset time period, the master device records the third abnormal information corresponding to the abnormal sub-device locally and controls itself to perform a restart operation to eliminate communication failures caused by abnormal master device software operation or system resource abnormalities.

[0075] After the main device restarts, the system re-checks the communication status between the main device and the malfunctioning sub-device. If the check result is still abnormal, the main device further controls itself and the malfunctioning sub-device to perform a reset operation simultaneously, causing both the main device and the malfunctioning sub-device to be re-powered and initialized at the hardware level to eliminate any potential persistent hardware or software anomalies. After the reset, the system re-checks the communication status between the main device and the malfunctioning sub-device; if the check result is still abnormal, it is assumed that the current fault cannot be eliminated through self-diagnosis and self-recovery methods. The main device reports the abnormal information to the management terminal, including the aforementioned first, second, and third abnormal information, as well as the location of each abnormality. This is to prompt maintenance personnel to pay close attention to the relevant main control processing unit, switching chip port, and the location of the malfunctioning sub-device, facilitating subsequent manual troubleshooting and fault replacement.

[0076] As an illustrative example of the first processing operation described above, such as Figure 3 As shown, in a specific embodiment, when the master device detects that the communication anomaly with sub-device A lasts for more than a second preset duration, while communication with other sub-devices is normal, it determines that the current scenario belongs to a single sub-device anomaly. In this scenario, the master device first controls sub-device A to power off and then power on again. During the restart process of sub-device A, the master device performs a self-test in parallel: first, it determines whether the network parameters of the master device's main control processing unit are normal. If an anomaly is detected, the network address, subnet mask, gateway, and other parameters are reconfigured according to preset values, and then the test is performed again. If the test is still abnormal, the "first anomaly information of the main control processing unit" is recorded locally.

[0077] Subsequently, the master device continues to check whether the status and configuration of the switching chip port connected to the abnormal sub-device are normal. If the test result is abnormal, the switching chip is reconfigured, and after configuration, the port is set to loopback mode and a loopback communication test is performed. If the loopback communication test result is still abnormal, a reset operation is performed on the physical layer unit and / or switching chip corresponding to the port. After reset, the loopback communication test is performed again. If the test result is still abnormal, the "second abnormal information" of the port is recorded. At this point, Figure 3 The self-diagnosis and self-recovery process shown on the left has ended.

[0078] After completing the above self-diagnosis and self-recovery operations, the main device starts timing and continuously monitors the communication status with sub-device A for a third preset time period after the self-diagnosis is completed. For example... Figure 3As shown on the right, if communication between the master device and sub-device A is still abnormal when the third preset time expires, the "third abnormal information" of sub-device A is recorded, and the master device itself is restarted. After the master device restarts, the communication status with sub-device A is checked again. If it is still abnormal, the master device and sub-device A are further controlled to perform a reset operation. After the reset is completed, the communication status between the two parties is checked again: if communication returns to normal at this time, it is considered that self-recovery has been completed; if it is still abnormal, the master device reports abnormal information to the management terminal. The reported content includes the aforementioned first abnormal information, second abnormal information, third abnormal information and their corresponding abnormal locations, prompting maintenance personnel to focus on checking the main control processing unit, related switching chip ports and the hardware connection of sub-device A. Conversely, if communication has returned to normal when the third preset time expires, or after the master device restarts, or after the master device and sub-device A are reset, there is no need to report an abnormality, and it is directly determined that the fault has been resolved through the automatic self-diagnosis and self-recovery process.

[0079] It should be noted that the various types of abnormal information recorded in the figure correspond to the specific requirements for recording abnormal information of the main control processing unit, abnormal information of the switching chip port, and abnormal information of the sub-device.

[0080] Step 104: When there are multiple abnormal sub-devices, the master device performs the third processing operation.

[0081] The third processing operation includes self-diagnosis and self-recovery of the main control processing unit, network interface, and switching chip port connected to the main device. In this embodiment, the third processing operation is used to deal with the situation where multiple abnormal sub-devices exist at the end of the second preset time period. At this time, the main device no longer prioritizes suspecting individual sub-device links, but tends to attribute the fault to the main device side or public network resources. Therefore, the main device initiates centralized self-diagnosis and self-recovery of its own critical network modules to restore overall communication capability as soon as possible.

[0082] Specifically, in this embodiment, the main device first performs self-diagnosis on its main control processing unit. The main control processing unit can read the network parameters and operating status information currently used for communication with the switching chip and external network, such as network address, subnet mask, gateway and interface status, and compare them with the preset normal configuration. When a configuration error or abnormal network status is detected on the main control processing unit side, the main device adjusts, reloads or reinitializes the relevant network parameters through a preset recovery process to restore the normal communication capability of the main control processing unit.

[0083] Subsequently, the master device performs self-diagnosis and self-recovery on its own network interface. By reading information such as the link status and negotiation parameters between the network interface and the switching chip, it determines whether the connection between the two is normal. If problems such as the link not being established, abnormal negotiation rate, or the interface being closed are found, the master device can perform a re-initialization or reset operation on the network interface to re-establish a stable link with the switching chip.

[0084] After completing the above diagnostics, the master device further performs self-diagnosis and self-recovery on the switching chip ports connected to it. The master device can access the switching chip's configuration registers via its internal control bus to check the enabling status, port mode, forwarding configuration, and virtual LAN settings of the ports connected to it. When the detection results indicate a configuration error or abnormal status of the port, the master device reconfigures, reinitializes, or resets the port according to a preset strategy to restore its normal forwarding capability. Through this third processing operation, in scenarios where multiple sub-devices experience simultaneous communication failures, the master device can centrally check and recover its own main control processing unit, network interfaces, and connected switching chip ports, prioritizing the elimination of public network resource failures, thereby improving the system's automatic recovery capability under large-scale abnormal situations.

[0085] In one possible implementation, the third processing operation specifically includes: The system detects the network parameters, connection status, and negotiation parameters of the main control processing unit, link layer unit, and physical layer unit of the main device. If the detection result is abnormal, the network parameters are reconfigured and / or the link layer unit and physical layer unit are reset. The system detects the connection status, operating mode, negotiation parameter status, and configuration of the switching chip port used for communication with the main device. If the detection result is abnormal, the switching chip is reconfigured, and the port is set to loopback operating mode for communication testing. If the loopback communication test result is abnormal, the physical layer unit and / or switching chip corresponding to the port is reconfigured or reset. If the loopback communication test result is still abnormal, the fourth abnormal information of the port is recorded. If any detection result is normal or all detection results are abnormal during the self-diagnosis process of the switching chip port connected to the main device, the communication status between the main device and multiple abnormal sub-devices will be detected again within the fourth preset time after the self-diagnosis. Any detection result includes one of the status and configuration detection results of the switching chip port connected to the main device, the loopback communication test result, and the loopback communication test result after reset. If the communication status between the master device and multiple abnormal sub-devices is in an abnormal state at the end of the fourth preset time period, the master device and all sub-devices will be reset. If the communication between the master device and multiple abnormal sub-devices still does not return to normal after the reset, abnormal information will be reported to the management terminal. The abnormal information also includes the fourth abnormal information and the abnormal location of the fourth abnormal information.

[0086] For example, such as Figure 4 As shown, in a specific embodiment, when the duration of communication anomalies between multiple sub-devices and the master device exceeds a second preset duration, the master device determines that the current scenario involves multiple sub-devices simultaneously experiencing anomalies and triggers a third processing operation. First, the master device checks its main control processing unit and the connected network interfaces to determine whether the network parameters, link layer units, and physical layer units of the master device's main control processing unit are normal. If the detection result is abnormal, the network parameters such as network address, subnet mask, and gateway information are reconfigured, and / or the link layer units and physical layer units are reset to restore the link between the master device and the switching chip to a normal state.

[0087] Subsequently, the main equipment enters Figure 4 The self-diagnostic process of the switching chip shown on the left determines whether the status and configuration of the switching chip port connected to the master device are normal. In actual implementation, the master device can read the registers of the switching chip through the software interface to check the global VLAN configuration, the enabled status of the port connected to the master device, the working mode, and negotiation rate, among other operating parameters. If the detection result is abnormal, the switching chip is reconfigured to restore it to the preset normal working configuration. After completing the parameter configuration, the master device sets the switching chip port connected to itself to loopback working mode and performs a loopback communication test to verify whether the transmit and receive paths of the port and its corresponding physical layer unit are normal. If communication is still abnormal in loopback working mode, a reset operation is further performed on the physical layer unit and / or switching chip corresponding to the port, and the loopback test is performed again after the reset. If the loopback communication test result is still abnormal after the reset, it is considered that there is a persistent fault in the port or its physical layer link, and the master device records the fourth abnormal information of the switching chip port, corresponding to... Figure 4 The step is to "record the fourth abnormal information of the switching chip port".

[0088] After completing the above self-diagnosis and self-recovery procedures, as follows: Figure 4As shown on the right, the master device continuously monitors its communication status with multiple abnormal sub-devices for a fourth preset duration starting from the end of the self-diagnosis. This fourth preset duration can be set based on the time required for switch chip reconfiguration, loopback testing, and link stabilization after reset. At the end of the fourth preset duration, if communication between the master device and all sub-devices returns to normal, the third processing operation ends; if multiple sub-devices still exhibit communication abnormalities, the master device executes "Reboot All Devices," simultaneously restarting both the master device and all sub-devices. After restarting, the communication status between the master device and each sub-device is checked again: if all communication is normal at this point, the process ends; if multiple sub-devices are still in an abnormal state, the master device records the identification information of these abnormal sub-devices and further executes "Reset All Devices," performing a unified hardware reset and power-on initialization of the master device and all sub-devices. After the reset is completed, the communication status between the main device and each sub-device is checked again. If it is still not normal, the main device reports the abnormal information to the management terminal. The reported content includes the fourth abnormal information recorded above and the abnormal location corresponding to the fourth abnormal information, which is used to guide maintenance personnel to focus on checking the switching chip port connected to the main device and related sub-devices, connecting cables and other hardware resources.

[0089] In the above method embodiments, a sub-device-side anomaly determination and self-recovery are introduced, with a first preset time limit as the boundary. When any sub-device detects a communication anomaly with the main device that persists for more than the first preset time limit, it is identified as an abnormal sub-device and a first processing operation is performed locally, achieving rapid self-diagnosis and self-recovery near the fault point, avoiding an initial restart of the main device or the entire machine. Furthermore, when there are still sub-devices that have not recovered to normal communication status within a second preset time limit, the main device detects the communication status between each sub-device and the main device and determines the number of abnormal sub-devices, distinguishing between scenarios with only one abnormal sub-device and scenarios with multiple abnormal sub-devices. When only one abnormal sub-device exists, the master device performs a second processing operation, performing self-diagnosis and self-recovery on its own main control processing unit, network interface, and the switch chip port connected to the abnormal sub-device. When multiple abnormal sub-devices exist, the master device performs a third processing operation, performing self-diagnosis and self-recovery on its own main control processing unit, network interface, and the switch chip port connected to the master device. This forms a collaborative mechanism of "sub-device local self-recovery + master device hierarchical processing according to the number of abnormalities," which improves the fault location accuracy and communication recovery speed of multi-master network devices, reduces the number of whole machine restarts and manual troubleshooting, and improves system operation stability.

[0090] See Figure 5 This illustration shows a network communication device provided in an embodiment of the present application, which is configured in a multi-master network communication system; for ease of explanation, only the parts related to the embodiments of the present application are shown.

[0091] Specifically, the network communication device 500 may include: The sub-device detection module 501 is used to determine that the sub-device is an abnormal sub-device when any sub-device detects that the communication with the main device is in an abnormal state and the abnormal duration exceeds a first preset time. The abnormal sub-device then performs a first processing operation to perform self-recovery. The main device detection module 502 is used to detect the communication status between at least one sub-device and the main device when there is a sub-device that has not recovered normal communication status within a second preset time period, and to determine the number of abnormal sub-devices among the multiple sub-devices. The first recovery module 503 is used to have the main device perform a second processing operation when there is an abnormal sub-device. The second processing operation includes: performing self-diagnosis and self-recovery on the main control processing unit, network interface and switching chip port connected to the abnormal sub-device of the main device. The second recovery module 504 is used to perform a third processing operation by the main device when there are multiple abnormal sub-devices. The third processing operation includes self-diagnosis and self-recovery of the main control processing unit, network interface and switching chip port connected to the main device.

[0092] In this embodiment, the network interface in the master device and each sub-device includes a link layer unit connected to the master control processing unit and a physical layer unit connected to the link layer unit.

[0093] In this embodiment, the sub-device detection module 501 may specifically include: The first detection unit is used to detect the network parameters of the main control processing unit of the abnormal sub-device. When the detection result is abnormal, the network parameters are reconfigured. The second detection unit is used to detect the connection status and negotiation parameters of the link layer unit and physical layer unit of the abnormal sub-device. When the detection result is abnormal, the network interface is reset. The third detection unit is used to detect the connection status, working mode, and negotiation parameters of the physical layer unit of the abnormal sub-device. When the detection result is abnormal, the physical layer unit is configured to loopback working mode and loopback communication test is performed. When the loopback communication test result is abnormal, the physical layer unit is reset.

[0094] In this embodiment of the application, the first recovery module 503 may specifically include: The power-on link layer unit is used to control the abnormal sub-device to power on and restart before performing self-diagnosis and self-recovery on the main control processing unit, network interface, and switching chip port connected to the abnormal sub-device of the main device.

[0095] In this embodiment of the application, the first recovery module 503 may further include: The fourth detection unit is used to detect the network parameters of the main control processing unit of the main device. When the detection result is abnormal, the network parameters are reconfigured. The first recording unit is used to detect the network parameters of the main control processing unit of the main device again after reconfiguration. When the detection result is abnormal, the first abnormal information of the main control processing unit is recorded. The fifth detection unit is used to detect the status and configuration of the switching chip port connected to the abnormal sub-device. When the detection result is abnormal, the switching chip is reconfigured and the port is set to loopback mode for communication testing. When the loopback communication test result is abnormal, the physical layer unit and / or the switching chip corresponding to the port is reset. When the loopback communication test result is still abnormal after the reset, the second abnormal information of the switching chip port is recorded.

[0096] In this embodiment of the application, the first recovery module 503 may further include: The first judgment unit is used to, during the self-diagnosis process of the switching chip port connected to the abnormal sub-device, if any detection result is normal or all detection results are abnormal, then within a third preset time period after the self-diagnosis, detect the communication status between the main device and the abnormal sub-device again, wherein any detection result includes one of the status and configuration detection results of the switching chip port connected to the abnormal sub-device, the loopback communication test result, and the loopback communication test result after reset. The second judgment unit is used to record the third abnormal information of the abnormal sub-device if the communication status between the master device and the abnormal sub-device is in an abnormal state at the end of the third preset time period, and control the master device to restart. After restarting, the communication status between the master device and the abnormal sub-device is checked again. If the detection result is abnormal, the master device and the abnormal sub-device are reset. After resetting, the communication status between the master device and the abnormal sub-device is checked again. If the detection result is abnormal, the abnormal information is reported to the management terminal. The abnormal information includes the first abnormal information, the second abnormal information, the third abnormal information, and the abnormal position of each abnormal information. The third judgment unit is used to determine that the self-recovery is completed if the communication status between the master device and the abnormal sub-device is in a normal state at the end of the third preset time period, or in a normal state after restarting, or in a normal state after resetting.

[0097] In this embodiment of the application, the second recovery module 504 may specifically include: The sixth detection unit is used to detect the network parameters, connection status and negotiation parameters of the main control processing unit, the link layer unit and the physical layer unit of the main device. When the detection result is abnormal, the network parameters are reconfigured and / or the link layer unit and the physical layer unit are reset. The seventh detection unit is used to detect the status and configuration of the switching chip port used for communication with the main device. When the detection result is abnormal, the switching chip is reconfigured and the port is set to loopback working mode for communication testing. When the loopback communication test result is abnormal, the physical layer unit and / or the switching chip corresponding to the port is reconfigured or reset. If the loopback communication test result is still abnormal, the fourth abnormal information of the port is recorded. The fourth judgment unit is used to detect the communication status between the main device and the plurality of abnormal sub-devices again within a fourth preset time period after the self-diagnosis if any detection result is normal or all detection results are abnormal during the self-diagnosis process of the switching chip port connected to the main device. The detection result includes one of the status and configuration detection result of the switching chip port connected to the main device, the loopback communication test result, and the loopback communication test result after reset. The fifth judgment unit is used to control the main device and all sub-devices to reset if the communication status between the main device and the multiple abnormal sub-devices is in an abnormal state at the end of the fourth preset time period. If the communication between the main device and the multiple abnormal sub-devices still does not return to normal after the reset, the unit reports abnormal information to the management terminal. The abnormal information also includes fourth abnormal information and the abnormal location of the fourth abnormal information.

[0098] In this embodiment, the network parameters in the network communication device 500 include at least network address, subnet mask and gateway information; the status and configuration of the switching chip port include at least virtual LAN configuration, port connection status, working mode and negotiation parameters.

[0099] The network communication device 500 provided in this application embodiment can be applied to the network communication method provided in the foregoing embodiment. For details, please refer to the description of the network communication method provided in the above embodiment, which will not be repeated here.

[0100] See Figure 6 The diagram illustrates the structure of a multi-master network communication system according to an embodiment of this application. Figure 6 As shown. The multi-master network communication system provided in this application embodiment can be applied to devices such as integrated cameras. The system includes a master device, multiple sub-devices, and a switching chip for internal data forwarding. The switching chip also connects to the user's intranet through an external port.

[0101] The main device includes a main control processing unit and a network interface connected to it. The main control processing unit can be a processor (such as a CPU) used to run communication management and fault handling programs. The network interface may include a Media Access Link Layer (MAC) unit and a Physical Layer (PHY) unit connected to the MAC. The PHY unit on the main device side is connected to the first port of the switching chip via an internal line. Figure 6 PORT1), thereby enabling data transmission and reception between the master device and the switching chip.

[0102] Each sub-device also has its own main control processing unit and a network interface connected to it. Each sub-device's network interface may also include MAC and PHY circuits. The PHYs on each sub-device side are connected to different ports of the switching chip (e.g., ...). Figure 6 (PORT2, PORT3 to PORTn), so that multiple sub-devices can access the internal network through the same switching chip. Each sub-device can handle its own business independently, and can also communicate with the master device and other sub-devices through the switching chip.

[0103] The switching chip internally contains a processing unit for forwarding control and multiple transceiver circuits corresponding one-to-one with external ports, such as... Figure 6 As shown: One port (PORT1) of the switching chip connects to the master device via an internal PHY / MAC address, multiple ports (PORT2~PORTn) connect to each sub-device via their respective PHY / MAC addresses, and another port (PORT0) connects to the user's intranet via a PHY address. This enables the entire multi-master network communication system to communicate with the user network or management terminal externally as a single network node. The master device uses this switching chip to uniformly manage the service data and heartbeat information of each sub-device and executes the anomaly detection and recovery processing described in the aforementioned network communication method, thus forming the following... Figure 6 The multi-master network communication system structure is shown.

[0104] This system implementation adopts a centralized access structure of "main device + multiple sub-devices + single switching chip" within the same device, enabling multiple main control boards to achieve high-bandwidth interconnection and unified management internally while occupying only one network node externally. This simplifies external cabling and network configuration, and provides a unified forwarding and control entry point for the aforementioned hierarchical anomaly detection and self-recovery strategies, thereby improving the overall communication stability and maintenance efficiency of the device.

[0105] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0106] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0107] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0108] In the embodiments provided in this application, it should be understood that the disclosed devices / detectors and methods can be implemented in other ways. For example, the device / simulator embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0109] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0110] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0111] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0112] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on the detector, the detector can implement the steps in the various method embodiments described above.

[0113] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A network communication method, characterized in that, An application in a multi-master network communication system, the system comprising a master device, at least one sub-device, and switching chips connected to the master device and each sub-device, wherein the master device and each sub-device respectively include a master control processing unit and a network interface connected to the master control processing unit; the method includes: When any of the sub-devices detects that the communication with the master device is in an abnormal state and the abnormal duration exceeds a first preset duration, the sub-device is determined to be an abnormal sub-device, and the abnormal sub-device performs a first processing operation to perform self-recovery; When there is a sub-device that has not recovered to normal communication status within a second preset time period, the master device detects the communication status between at least one sub-device and the master device, and determines the number of abnormal sub-devices among the multiple sub-devices. When an abnormal sub-device exists, the master device performs a second processing operation, which includes: performing self-diagnosis and self-recovery on the master device's main control processing unit, network interface, and switching chip port connected to the abnormal sub-device; When multiple abnormal sub-devices exist, the main device performs a third processing operation, which includes self-diagnosis and self-recovery of the main control processing unit, network interface, and switching chip port connected to the main device.

2. The method as described in claim 1, characterized in that, The network interfaces in the main device and each of the sub-devices include a link layer unit connected to the main control processing unit and a physical layer unit connected to the link layer unit; The link layer unit is used to send and receive data link layer messages, and the physical layer unit is used to send and receive physical layer signals.

3. The method as described in claim 2, characterized in that, The first processing operation includes: The network parameters of the main control processing unit of the abnormal sub-device are detected, and the network parameters are reconfigured when the detection result is abnormal. The connection status and negotiation parameters of the link layer unit and the physical layer unit of the abnormal sub-device are detected, and the network interface is reset when the detection result is abnormal. The connection status, operating mode, and negotiation parameters of the physical layer unit of the abnormal sub-device are detected. If the detection result is abnormal, the physical layer unit is configured to loopback operating mode and loopback communication test is performed. If the loopback communication test result is abnormal, the physical layer unit is reset.

4. The method as described in claim 2, characterized in that, The second processing operation further includes: Before performing self-diagnosis and self-recovery on the main control processing unit, network interface, and switching chip port connected to the abnormal sub-device of the main device, control the abnormal sub-device to power on and restart.

5. The method as described in claim 4, characterized in that, The self-diagnosis and self-recovery of the main control processing unit, network interface, and switching chip port connected to the abnormal sub-device of the main device includes: The network parameters of the main control processing unit of the main device are detected, and the network parameters are reconfigured when the detection result is abnormal. After reconfiguration, the network parameters of the main control processing unit of the main device are checked again. If the result of the second check is abnormal, the first abnormal information of the main control processing unit is recorded. The status and configuration of the switching chip port connected to the abnormal sub-device are detected. If the detection result is abnormal, the switching chip is reconfigured and the port is set to loopback mode for communication testing. If the loopback communication test result is abnormal, the physical layer unit corresponding to the port and / or the switching chip is reset. If the loopback communication test result is still abnormal after the reset, the second abnormal information of the switching chip port is recorded.

6. The method as described in claim 5, characterized in that, The self-diagnosis and self-recovery of the main control processing unit, network interface, and switching chip port connected to the abnormal sub-device of the main device also includes: During the self-diagnosis process of the switching chip port connected to the abnormal sub-device, if any detection result is normal or all detection results are abnormal, the communication status between the main device and the abnormal sub-device is detected again within the third preset time after the self-diagnosis. The detection result includes one of the status and configuration detection results of the switching chip port connected to the abnormal sub-device, the loopback communication test result, and the loopback communication test result after reset. If the communication status between the master device and the abnormal sub-device is abnormal at the end of the third preset time period, the third abnormal information of the abnormal sub-device is recorded, and the master device is controlled to restart. After restarting, the communication status between the master device and the abnormal sub-device is checked again. If the detection result is abnormal, the master device and the abnormal sub-device are controlled to reset. After resetting, the communication status between the master device and the abnormal sub-device is checked again. If the detection result is abnormal, abnormal information is reported to the management terminal. The abnormal information includes the first abnormal information, the second abnormal information, the third abnormal information, and the abnormal position of each abnormal information. If the communication status between the master device and the abnormal sub-device is in a normal state at the end of the third preset time period, or in a normal state after restarting, or in a normal state after resetting, then the self-recovery is determined to be complete.

7. The method as described in claim 2, characterized in that, The third processing operation includes: The network parameters, connection status, and negotiation parameters of the main control processing unit of the main device are detected. If the detection result is abnormal, the network parameters are reconfigured and / or the link layer unit and physical layer unit are reset. The status and configuration of the switching chip port used for communication with the master device are detected. If the detection result is abnormal, the switching chip is reconfigured and the port is set to loopback mode for communication testing. If the loopback communication test result is abnormal, the physical layer unit and / or the switching chip corresponding to the port are reconfigured or reset. If the loopback communication test result is still abnormal, the fourth abnormal information of the port is recorded. If, during the self-diagnosis process of the switching chip port connected to the main device, any detection result is normal or all detection results are abnormal, then within the fourth preset time after the self-diagnosis, the communication status between the main device and the plurality of abnormal sub-devices is detected again. The detection result includes one of the status and configuration detection results of the switching chip port connected to the main device, the loopback communication test result, and the loopback communication test result after reset. If the communication status between the master device and the multiple abnormal sub-devices is in an abnormal state at the end of the fourth preset time period, the master device and all sub-devices are controlled to be reset. If the communication between the master device and the multiple abnormal sub-devices still does not return to normal after the reset, abnormal information is reported to the management terminal. The abnormal information also includes a fourth abnormal information and the abnormal location of the fourth abnormal information.

8. The method according to any one of claims 1 to 7, characterized in that, The network parameters include at least the network address, subnet mask, and gateway information; the status and configuration of the switching chip port include at least the virtual LAN configuration, port connection status, operating mode, and negotiation parameters.

9. A network communication device, characterized in that, Configured in a multi-master network communication system, the system includes a master device, at least one sub-device, and switching chips connected to the master device and each sub-device. The master device and each sub-device each include a master control processing unit and a network interface connected to the master control processing unit. The device includes: The sub-device detection module is used to determine that the sub-device is an abnormal sub-device when any of the sub-devices detects that the communication with the master device is in an abnormal state and the abnormal duration exceeds a first preset time. The abnormal sub-device then performs a first processing operation to perform self-recovery. The main device detection module is used to detect the communication status between at least one sub-device and the main device when there is a sub-device that has not recovered normal communication status within a second preset time period, and to determine the number of abnormal sub-devices among the multiple sub-devices. The first recovery module is used to have the main device perform a second processing operation when there is an abnormal sub-device. The second processing operation includes: performing self-diagnosis and self-recovery on the main control processing unit, network interface and switching chip port connected to the abnormal sub-device of the main device. The second recovery module is used to perform a third processing operation by the main device when there are multiple abnormal sub-devices. The third processing operation includes self-diagnosis and self-recovery of the main control processing unit, network interface and switching chip port connected to the main device.

10. A multi-master network communication system, characterized in that, The system includes: a main device, at least one sub-device, and a switching chip connected to the main device and each sub-device. The main device and each sub-device respectively include a main control processing unit and a network interface connected to the main control processing unit, for performing the method as described in any one of claims 1 to 8.